fix warnings in cppexp.c

Andreas Jaeger aj@suse.de
Sat Jun 1 06:17:00 GMT 2002


With current CVS I got on x86-64:

/usr/src/aj/regression/sources/gcc/gcc/gcc/cppexp.c:247: warning: field precision is not type int (arg 4)
/usr/src/aj/regression/sources/gcc/gcc/gcc/cppexp.c:257: warning: field precision is not type int (arg 4)
/usr/src/aj/regression/sources/gcc/gcc/gcc/cppexp.c:268: warning: field precision is not type int (arg 4)
/usr/src/aj/regression/sources/gcc/gcc/gcc/cppexp.c:278: warning: field precision is not type int (arg 4)

Ok to commit?  Bootstrapped/regtested on i686-linux-gnu,

Andreas

2002-06-01  Andreas Jaeger  <aj@suse.de>

	* cppexp.c (cpp_classify_number): Cast precission to int for
	correct printf format.

============================================================
Index: gcc/cppexp.c
--- gcc/cppexp.c	29 May 2002 17:15:29 -0000	1.120
+++ gcc/cppexp.c	1 Jun 2002 08:31:11 -0000
@@ -244,7 +244,7 @@ cpp_classify_number (pfile, token)
 	{
 	  cpp_error (pfile, DL_ERROR,
 		     "invalid suffix \"%.*s\" on floating constant",
-		     limit - str, str);
+		     (int) (limit - str), str);
 	  return CPP_N_INVALID;
 	}
 
@@ -254,7 +254,7 @@ cpp_classify_number (pfile, token)
 	  && ! cpp_sys_macro_p (pfile))
 	cpp_error (pfile, DL_WARNING,
 		   "traditional C rejects the \"%.*s\" suffix",
-		   limit - str, str);
+		   (int) (limit - str), str);
 
       result |= CPP_N_FLOATING;
     }
@@ -265,7 +265,7 @@ cpp_classify_number (pfile, token)
 	{
 	  cpp_error (pfile, DL_ERROR,
 		     "invalid suffix \"%.*s\" on integer constant",
-		     limit - str, str);
+		     (int) (limit - str), str);
 	  return CPP_N_INVALID;
 	}
 
@@ -275,7 +275,7 @@ cpp_classify_number (pfile, token)
 	  && ! cpp_sys_macro_p (pfile))
 	cpp_error (pfile, DL_WARNING,
 		   "traditional C rejects the \"%.*s\" suffix",
-		   limit - str, str);
+		   (int) (limit - str), str);
 
       if ((result & CPP_N_WIDTH) == CPP_N_LARGE
 	  && ! CPP_OPTION (pfile, c99)

-- 
 Andreas Jaeger
  SuSE Labs aj@suse.de
   private aj@arthur.inka.de
    http://www.suse.de/~aj



More information about the Gcc-patches mailing list