This is the mail archive of the 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] PR15824: Broken configure test in libcpp

On Tue, 23 Nov 2004, Zack Weinberg wrote:
> Roger Sayle <> writes:
> > My suggested fix below is to completely ignore "ansidecl.h" and
> > the not yet generated "system.h", and directly include <sys/types.h>
> > as described in this test's commentary.  If sys/types.h doesn't
> > exist, we're no worse off than we currently are, but on AIX and
> > Tru64, this simplified test is sufficient to do the right thing.
> >
> > Ok for mainline?
> Yes, this is OK.  I worry a little about systems where some other
> header is the one that defines uchar, but let's cross that bridge when
> we discover it.

Many thanks.

I apologise for teasing a second review out of you, but the form of
the patch below was dependent upon the solution chosen for PR15824.

Now that libcpp is fixed, there is a related problem in the gcc/
directory caused by the #include "../libcpp/internal.h" in the file
c-ppoutput.c.  There's now a warning/bootstrap failure as libcpp's
internal.h, includes libcpp/include/cpp-id-data.h which contains the
test for HAVE_UCHAR.  Unfortunately, HAVE_UCHAR is only in libcpp's
config.h, but not in gcc's auto-host.h.

My proposed solution in the patch below is to copy the configure
test for HAVE_UCHAR from libcpp's, and repeat the
test in the gcc directory's configure.

Clearly, there's an aspect of duplication and potential divergence
that is a concern.  However, with my limited autoconf knowledge
(and the lack of include guards on config.h) this seems like the
appropriate approach.

The following patch bas been tested on powerpc-ibm-aix5.2.0.0 with
a top-level "make".

Ok for mainline?

2004-11-24  Roger Sayle  <>

	* Copy HAVE_UCHAR test from libcpp/
	* configure, Regenerate.

RCS file: /cvs/gcc/gcc/gcc/,v
retrieving revision 2.84
diff -c -3 -p -r2.84
***	22 Nov 2004 22:26:06 -0000	2.84
---	24 Nov 2004 14:42:58 -0000
*************** if test $gcc_cv_type_clock_t = yes; then
*** 1095,1100 ****
--- 1095,1112 ----
    [Define if <time.h> defines clock_t.])

+ AC_CACHE_CHECK(for uchar, gcc_cv_type_uchar,
+ #include <sys/types.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
+   [Define if <sys/types.h> defines \`uchar'.])
+ fi
  # Restore CFLAGS from before the gcc_AC_NEED_DECLARATIONS tests.

Roger Sayle,                         E-mail:
OpenEye Scientific Software,         WWW:
Suite 1107, 3600 Cerrillos Road,     Tel: (+1) 505-473-7385
Santa Fe, New Mexico, 87507.         Fax: (+1) 505-473-0833

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