autoconf
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

AC_CHECK_SIZEOF failing on undefined HAVE_STDINT_H with -Werror


From: David Fang
Subject: AC_CHECK_SIZEOF failing on undefined HAVE_STDINT_H with -Werror
Date: Mon, 14 Aug 2006 23:42:28 -0400 (EDT)

Hi autoconf-ers,

        I'm having a problem configuring a project using -Werror because
tests for AC_CHECK_SIZEOF() all die in the following manner (excerpt of
config.log):
(These tests fail on FreeBSD 4.3 which doesn't have <stdint.h>.
The AC_CHECK_HEADERS([stdint.h]) confirms this during configure.)

-------->8 snip 8<--------
configure:38997: checking for char
configure:39027: ccache gcc-3.4.0 -c  -ansi -pedantic-errors  -W -Wall
-Wundef -
Wshadow -Wno-unused-parameter -Wpointer-arith -Wcast-qual -Wcast-align
-Wconvers
ion -Werror  -Wmissing-prototypes -Wstrict-prototypes -Wbad-function-cast
-Wnest
ed-externs  -Wno-unused -Wno-shadow -Wno-cast-qual  -Wno-strict-prototypes
-Wno-
missing-prototypes -g0 -O2  conftest.c >&5
distcc[35090] ERROR: compile on localhost failed
conftest.c:200:5: "HAVE_STDINT_H" is not defined
distcc[35089] ERROR: compile on maxwell/1 failed
configure:39033: $? = 1
configure: failed program was:
| /* confdefs.h.  */
-------->8 snip 8<--------
// ton of #defines
-------->8 snip 8<--------
| #if HAVE_STDINT_H
| # include <stdint.h>
| #endif
-------->8 snip 8<--------


This error only started occurring to me after upgrading to autoconf-2.60,
but I don't have 2.59 handy anymore to confirm whether or not this is a
regression.  (This never used to be a problem.)  In any case, correct me
if I'm wrong, but to me it seems like the recipe for fixing this would be
to rewrite the #include part of conftest.c as:

| #ifdef HAVE_STDINT_H
| # include <stdint.h>
| #endif

After all, isn't this the convention used in producing "config.h"
and using it for conditional #includes?

The temporary workaround is to pass an additional -Wno-undef to
CFLAGS/CXXFLAGS, so this isn't the end of the world, just a slight
annoyance.  I do want to make sure this particular project is "-ansi
-pedantic-errors -W -Wall -Werror"-clean, which includes rejecting
non-standard types such as 'long long'.  Of course, I'm aware that such
strict flags may affect the outcome of various configure tests in
unexpected ways... I try to be cautious.

Thanks in advance.

Fang






reply via email to

[Prev in Thread] Current Thread [Next in Thread]