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]

Re: Patch to enable -Werror [take 2]


David Edelsohn <dje@watson.ibm.com> writes:

> 	I think you have positioned this check too early in configure.in
> -- before CFLAGS has been set to look for ansidecl.h and system.h.

Yes, you're right, it should be down near the check for clock_t.  Try
this patch instead.

zw

===================================================================
Index: configure.in
--- configure.in	15 Jan 2003 10:53:22 -0000	1.634
+++ configure.in	20 Jan 2003 21:46:08 -0000
@@ -784,6 +784,19 @@ if test $gcc_cv_type_clock_t = yes; then
   [Define if <time.h> defines clock_t.])
 fi
 
+AC_CACHE_CHECK(for uchar, gcc_cv_type_uchar,
+[AC_TRY_COMPILE([
+#include "ansidecl.h"
+#include "system.h"
+], 
+[if ((uchar *)0) return 0;
+ if (sizeof(uchar)) return 0;],
+ac_cv_type_uchar=yes, ac_cv_type_uchar=no)])
+if test $ac_cv_type_uchar = yes; then
+  AC_DEFINE(HAVE_UCHAR, 1,
+  [Define if <sys/types.h> provides `uchar'.])
+fi
+
 # Restore CFLAGS from before the gcc_AC_NEED_DECLARATIONS tests.
 CFLAGS="$saved_CFLAGS"
 
===================================================================
Index: cpphash.h
--- cpphash.h	18 Jan 2003 02:26:41 -0000	1.174
+++ cpphash.h	20 Jan 2003 21:46:08 -0000
@@ -29,7 +29,9 @@ struct directive;		/* Deliberately incom
 struct pending_option;
 struct op;
 
+#ifndef HAVE_UCHAR
 typedef unsigned char uchar;
+#endif
 #define U (const uchar *)  /* Intended use: U"string" */
 
 #define BITS_PER_CPPCHAR_T (CHAR_BIT * sizeof (cppchar_t))


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