public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/30452]  New: Strange syntax error with high-value character
@ 2007-01-12 22:50 tkoenig at gcc dot gnu dot org
  2007-01-13  7:01 ` [Bug fortran/30452] " jvdelisle at gcc dot gnu dot org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: tkoenig at gcc dot gnu dot org @ 2007-01-12 22:50 UTC (permalink / raw)
  To: gcc-bugs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 785 bytes --]

This shouldn't be rejected. g77 accepts this.

$ cat char.f
      program main
      if (char (254) /= "þ") call abort
      end program main
$ gfortran char.f
char.f:2.24:

      if (char (254) /= "\xFE") call abort
                       1
Error: Unterminated character constant beginning at (1)
$ g77 char.f
$


-- 
           Summary: Strange syntax error with high-value character
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Keywords: rejects-valid
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: tkoenig at gcc dot gnu dot org
OtherBugsDependingO 19292
             nThis:


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30452


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug fortran/30452] Strange syntax error with high-value character
  2007-01-12 22:50 [Bug fortran/30452] New: Strange syntax error with high-value character tkoenig at gcc dot gnu dot org
@ 2007-01-13  7:01 ` jvdelisle at gcc dot gnu dot org
  2007-01-13  7:20 ` jvdelisle at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2007-01-13  7:01 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from jvdelisle at gcc dot gnu dot org  2007-01-13 07:00 -------
At the lowest level, next_char in scanner.c is returning -2. That is not right
for sure.  I am wondering if there is an error reading the file.  I will dig
further.


-- 

jvdelisle at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |jvdelisle at gcc dot gnu dot
                   |dot org                     |org
             Status|UNCONFIRMED                 |ASSIGNED
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2007-01-13 07:00:46
               date|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30452


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug fortran/30452] Strange syntax error with high-value character
  2007-01-12 22:50 [Bug fortran/30452] New: Strange syntax error with high-value character tkoenig at gcc dot gnu dot org
  2007-01-13  7:01 ` [Bug fortran/30452] " jvdelisle at gcc dot gnu dot org
@ 2007-01-13  7:20 ` jvdelisle at gcc dot gnu dot org
  2007-01-13  8:42 ` Thomas dot Koenig at online dot de
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2007-01-13  7:20 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from jvdelisle at gcc dot gnu dot org  2007-01-13 07:20 -------
Turns out that the character 254 which is Hex FE is also the 2's complement
representation of -2 which is what is used to signal an error if there is a
missing delimiter.  It should not be converting this to an int -2


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30452


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug fortran/30452] Strange syntax error with high-value character
  2007-01-12 22:50 [Bug fortran/30452] New: Strange syntax error with high-value character tkoenig at gcc dot gnu dot org
  2007-01-13  7:01 ` [Bug fortran/30452] " jvdelisle at gcc dot gnu dot org
  2007-01-13  7:20 ` jvdelisle at gcc dot gnu dot org
@ 2007-01-13  8:42 ` Thomas dot Koenig at online dot de
  2007-01-13 11:51 ` Thomas dot Koenig at online dot de
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Thomas dot Koenig at online dot de @ 2007-01-13  8:42 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from Thomas dot Koenig at online dot de  2007-01-13 08:42 -------
Subject: Re:  Strange syntax error with high-value character

jvdelisle at gcc dot gnu dot org wrote:

> Turns out that the character 254 which is Hex FE is also the 2's complement
> representation of -2 which is what is used to signal an error if there is a
> missing delimiter.  It should not be converting this to an int -2

Same thing happens for character 255, BTW.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30452


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug fortran/30452] Strange syntax error with high-value character
  2007-01-12 22:50 [Bug fortran/30452] New: Strange syntax error with high-value character tkoenig at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2007-01-13  8:42 ` Thomas dot Koenig at online dot de
@ 2007-01-13 11:51 ` Thomas dot Koenig at online dot de
  2007-01-13 18:45 ` jvdelisle at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Thomas dot Koenig at online dot de @ 2007-01-13 11:51 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from Thomas dot Koenig at online dot de  2007-01-13 11:51 -------
Subject: Re:  Strange syntax error with high-value character

jvdelisle at gcc dot gnu dot org wrote:

> Turns out that the character 254 which is Hex FE is also the 2's complement
> representation of -2 which is what is used to signal an error if there is a
> missing delimiter.  It should not be converting this to an int -2

Here's a patch which fixes the testcase.

Currently regtesting.


------- Comment #5 from Thomas dot Koenig at online dot de  2007-01-13 11:51 -------
Created an attachment (id=12895)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=12895&action=view)


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30452


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug fortran/30452] Strange syntax error with high-value character
  2007-01-12 22:50 [Bug fortran/30452] New: Strange syntax error with high-value character tkoenig at gcc dot gnu dot org
                   ` (3 preceding siblings ...)
  2007-01-13 11:51 ` Thomas dot Koenig at online dot de
@ 2007-01-13 18:45 ` jvdelisle at gcc dot gnu dot org
  2007-01-14 11:01 ` tkoenig at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2007-01-13 18:45 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from jvdelisle at gcc dot gnu dot org  2007-01-13 18:45 -------
Assuming this regression tests OK, I think this is an "obvious and simple" 
Thanks :)


-- 

jvdelisle at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|jvdelisle at gcc dot gnu dot|unassigned at gcc dot gnu
                   |org                         |dot org
             Status|ASSIGNED                    |NEW


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30452


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug fortran/30452] Strange syntax error with high-value character
  2007-01-12 22:50 [Bug fortran/30452] New: Strange syntax error with high-value character tkoenig at gcc dot gnu dot org
                   ` (4 preceding siblings ...)
  2007-01-13 18:45 ` jvdelisle at gcc dot gnu dot org
@ 2007-01-14 11:01 ` tkoenig at gcc dot gnu dot org
  2007-01-15 20:27 ` [Bug fortran/30452] [4.2, 4.1 only] " tkoenig at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: tkoenig at gcc dot gnu dot org @ 2007-01-14 11:01 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from tkoenig at gcc dot gnu dot org  2007-01-14 11:01 -------
Subject: Bug 30452

Author: tkoenig
Date: Sun Jan 14 11:01:20 2007
New Revision: 120768

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=120768
Log:
2007-01-14  Thomas Koenig  <Thomas.Koenig@online.de>

        PR fortran/30452
        * scanner.c(next_char):  Cast next character to unsigned
        to avoid confusion with error return codes.

2007-01-14  Thomas Koenig  <Thomas.Koenig@online.de>

        PR fortran/30452
        * gfortran.dg/string_0xfe_0xff_1.f90:  New test.


Added:
    trunk/gcc/testsuite/gfortran.dg/string_0xfe_0xff_1.f90
Modified:
    trunk/gcc/fortran/scanner.c
    trunk/gcc/testsuite/ChangeLog


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30452


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug fortran/30452] [4.2, 4.1 only] Strange syntax error with high-value character
  2007-01-12 22:50 [Bug fortran/30452] New: Strange syntax error with high-value character tkoenig at gcc dot gnu dot org
                   ` (5 preceding siblings ...)
  2007-01-14 11:01 ` tkoenig at gcc dot gnu dot org
@ 2007-01-15 20:27 ` tkoenig at gcc dot gnu dot org
  2007-01-31  7:37 ` tkoenig at gcc dot gnu dot org
  2007-01-31  7:38 ` tkoenig at gcc dot gnu dot org
  8 siblings, 0 replies; 10+ messages in thread
From: tkoenig at gcc dot gnu dot org @ 2007-01-15 20:27 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from tkoenig at gcc dot gnu dot org  2007-01-15 20:27 -------
Fixed on trunk, will backport to 4.2 in a week or so.


-- 

tkoenig at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Known to fail|                            |4.2.0 4.1.2
      Known to work|                            |4.3.0
            Summary|Strange syntax error with   |[4.2, 4.1 only] Strange
                   |high-value character        |syntax error with high-value
                   |                            |character


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30452


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug fortran/30452] [4.2, 4.1 only] Strange syntax error with high-value character
  2007-01-12 22:50 [Bug fortran/30452] New: Strange syntax error with high-value character tkoenig at gcc dot gnu dot org
                   ` (6 preceding siblings ...)
  2007-01-15 20:27 ` [Bug fortran/30452] [4.2, 4.1 only] " tkoenig at gcc dot gnu dot org
@ 2007-01-31  7:37 ` tkoenig at gcc dot gnu dot org
  2007-01-31  7:38 ` tkoenig at gcc dot gnu dot org
  8 siblings, 0 replies; 10+ messages in thread
From: tkoenig at gcc dot gnu dot org @ 2007-01-31  7:37 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #9 from tkoenig at gcc dot gnu dot org  2007-01-31 07:37 -------
Subject: Bug 30452

Author: tkoenig
Date: Wed Jan 31 07:37:08 2007
New Revision: 121378

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=121378
Log:
2007-01-31  Thomas Koenig  <Thomas.Koenig@online.de>

        Backport from trunk
        PR fortran/30452
        * scanner.c(next_char):  Cast next character to unsigned
        to avoid confusion with error return codes.

2007-01-31  Thomas Koenig  <Thomas.Koenig@online.de>

        Backport from trunk
        PR fortran/30452
        * gfortran.dg/string_0xfe_0xff_1.f90:  New test.


Added:
    branches/gcc-4_2-branch/gcc/testsuite/gfortran.dg/string_0xfe_0xff_1.f90
Modified:
    branches/gcc-4_2-branch/gcc/fortran/ChangeLog
    branches/gcc-4_2-branch/gcc/fortran/scanner.c


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30452


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug fortran/30452] [4.2, 4.1 only] Strange syntax error with high-value character
  2007-01-12 22:50 [Bug fortran/30452] New: Strange syntax error with high-value character tkoenig at gcc dot gnu dot org
                   ` (7 preceding siblings ...)
  2007-01-31  7:37 ` tkoenig at gcc dot gnu dot org
@ 2007-01-31  7:38 ` tkoenig at gcc dot gnu dot org
  8 siblings, 0 replies; 10+ messages in thread
From: tkoenig at gcc dot gnu dot org @ 2007-01-31  7:38 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #10 from tkoenig at gcc dot gnu dot org  2007-01-31 07:38 -------
Fixed on trunk and 4.2.  Closing.

One down, a few more to go :-)


-- 

tkoenig at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30452


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2007-01-31  7:38 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-01-12 22:50 [Bug fortran/30452] New: Strange syntax error with high-value character tkoenig at gcc dot gnu dot org
2007-01-13  7:01 ` [Bug fortran/30452] " jvdelisle at gcc dot gnu dot org
2007-01-13  7:20 ` jvdelisle at gcc dot gnu dot org
2007-01-13  8:42 ` Thomas dot Koenig at online dot de
2007-01-13 11:51 ` Thomas dot Koenig at online dot de
2007-01-13 18:45 ` jvdelisle at gcc dot gnu dot org
2007-01-14 11:01 ` tkoenig at gcc dot gnu dot org
2007-01-15 20:27 ` [Bug fortran/30452] [4.2, 4.1 only] " tkoenig at gcc dot gnu dot org
2007-01-31  7:37 ` tkoenig at gcc dot gnu dot org
2007-01-31  7:38 ` tkoenig at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).