This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Patch to enable -Werror [take 2]
- From: Zack Weinberg <zack at codesourcery dot com>
- To: David Edelsohn <dje at watson dot ibm dot com>
- Cc: Rainer Orth <ro at TechFak dot Uni-Bielefeld dot DE>, "Kaveh R. Ghazi" <ghazi at caip dot rutgers dot edu>, gcc-patches at gcc dot gnu dot org
- Date: Mon, 20 Jan 2003 13:46:16 -0800
- Subject: Re: Patch to enable -Werror [take 2]
- References: <200301202132.QAA31350@makai.watson.ibm.com>
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))