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]

Fix cppinit format problems



On a 64-bit host I got these warnings bootstrapping GCC:
/sources/gcc/gcc/gcc/cppinit.c:862: warning: unsigned int format, different type arg (arg 4)
/sources/gcc/gcc/gcc/cppinit.c:862: warning: unsigned int format, different type arg (arg 5)
/sources/gcc/gcc/gcc/cppinit.c:882: warning: unsigned int format, different type arg (arg 4)
/sources/gcc/gcc/gcc/cppinit.c:882: warning: unsigned int format, different type arg (arg 5)

We try to print elements of type size_t.  Ok to commit the appended
patch?  Bootstrapped/regtested on i686-linux-gnu.

Andreas

2002-05-21  Andreas Jaeger  <aj@suse.de>

	* cppinit.c (sanity_checks): Avoid printf mismatch warnings.

============================================================
Index: gcc/cppinit.c
--- gcc/cppinit.c	18 May 2002 08:23:19 -0000	1.228
+++ gcc/cppinit.c	21 May 2002 07:25:39 -0000
@@ -858,8 +858,9 @@ static void sanity_checks (pfile)
 
   if (CPP_OPTION (pfile, precision) > BITS_PER_HOST_WIDEST_INT)
     cpp_error (pfile, DL_FATAL,
-	       "preprocessor arithmetic has maximum precision of %u bits; target requires %u bits",
-	       BITS_PER_HOST_WIDEST_INT, CPP_OPTION (pfile, precision));
+	       "preprocessor arithmetic has maximum precision of %lu bits; target requires %lu bits",
+	       (unsigned long)BITS_PER_HOST_WIDEST_INT,
+	       (unsigned long)CPP_OPTION (pfile, precision));
 
   if (CPP_OPTION (pfile, precision) < CPP_OPTION (pfile, int_precision))
     cpp_error (pfile, DL_FATAL,
@@ -878,8 +879,9 @@ static void sanity_checks (pfile)
 
   if (CPP_OPTION (pfile, wchar_precision) > BITS_PER_CPPCHAR_T)
     cpp_error (pfile, DL_FATAL,
-	       "CPP on this host cannot handle wide character constants over %u bits, but the target requires %u bits",
-	       BITS_PER_CPPCHAR_T, CPP_OPTION (pfile, wchar_precision));
+	       "CPP on this host cannot handle wide character constants over %lu bits, but the target requires %lu bits",
+	       (unsigned long)BITS_PER_CPPCHAR_T,
+	       (unsigned long)CPP_OPTION (pfile, wchar_precision));
 }
 #else
 # define sanity_checks(PFILE)


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


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