re PR fortran/30452 ([4.2, 4.1 only] Strange syntax error with high-value character)

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.

From-SVN: r120768
This commit is contained in:
Thomas Koenig 2007-01-14 11:01:20 +00:00 committed by Thomas Koenig
parent 326648f1bd
commit 16a374c6c8
3 changed files with 13 additions and 1 deletions

View File

@ -345,7 +345,7 @@ next_char (void)
if (gfc_current_locus.nextc == NULL)
return '\n';
c = *gfc_current_locus.nextc++;
c = (unsigned char) *gfc_current_locus.nextc++;
if (c == '\0')
{
gfc_current_locus.nextc--; /* Remain on this line. */

View File

@ -1,3 +1,8 @@
2007-01-14 Thomas Koenig <Thomas.Koenig@online.de>
PR fortran/30452
* gfortran.dg/string_0xfe_0xff_1.f90: New test.
2007-01-13 Zdenek Dvorak <dvorakz@suse.cz>
* gcc.dg/20070112-1.c: New test.

View File

@ -0,0 +1,7 @@
! { dg-do compile }
! PR 30452 - this used to cause syntax errors due to the presence,
! as characters, of bytes 0xfe and 0xff.
program main
if (char (254) /= "þ") call abort
if (achar (255) /= "ÿ") call abort
end program main