summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortkoenig <tkoenig@138bc75d-0d04-0410-961f-82ee72b054a4>2007-01-14 11:01:20 +0000
committertkoenig <tkoenig@138bc75d-0d04-0410-961f-82ee72b054a4>2007-01-14 11:01:20 +0000
commit7dbf7c8d00b5b5913f510a1f4e11f2c1203a6b3b (patch)
tree3a72ff90a8656267938a29f300437afce402dfbb
parentfe15b70175fda71e7c4d6d3b7239d7be13497e02 (diff)
downloadgcc-7dbf7c8d00b5b5913f510a1f4e11f2c1203a6b3b.tar.gz
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@120768 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/fortran/scanner.c2
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gfortran.dg/string_0xfe_0xff_1.f907
3 files changed, 13 insertions, 1 deletions
diff --git a/gcc/fortran/scanner.c b/gcc/fortran/scanner.c
index d97d5851a36..4949fe60572 100644
--- a/gcc/fortran/scanner.c
+++ b/gcc/fortran/scanner.c
@@ -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. */
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 7c3b7698730..ce42aaa2f5b 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -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.
diff --git a/gcc/testsuite/gfortran.dg/string_0xfe_0xff_1.f90 b/gcc/testsuite/gfortran.dg/string_0xfe_0xff_1.f90
new file mode 100644
index 00000000000..e3ea0429646
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/string_0xfe_0xff_1.f90
@@ -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