[gfortran] Fix IO library end of fmt bug

Paul Brook paul@codesourcery.com
Sun May 16 18:21:00 GMT 2004


In io/format.c we were assigning the result of next_char() to a "char". This 
function can return -1, so breaks on machines where the default char is 
unsigned.

Patch below applied to mainline.

Paul

2004-05-16  Paul Brook  <paul@codesourcery.com>

	* io/format.c (format_lex): Make c an int.

Index: io/format.c
===================================================================
RCS file: /var/cvsroot/gcc-cvs/gcc/libgfortran/io/format.c,v
retrieving revision 1.3
diff -u -p -r1.3 format.c
--- a/io/format.c	13 May 2004 23:36:16 -0000	1.3
+++ b/io/format.c	16 May 2004 18:09:13 -0000
@@ -164,7 +164,8 @@ format_lex (void)
 {
   format_token token;
   int negative_flag;
-  char c, delim;
+  int c;
+  char delim;
 
   if (saved_token != FMT_NONE)
     {



More information about the Fortran mailing list