This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[gfortran] Fix IO library end of fmt bug


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)
     {


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]