FATAL: assertion failed: foobar.cc:123: "EX"
Autoconf v2.71 provides AC_HEADER_STDC that does not define
STDC_HEADERS. As a result, our assert() macro definitions print "EX"
instead of the actual failed condition when Squid is bootstrapped with
Autoconf v2.71 or later.
Autoconf documentation suggests writing code as if STDC_HEADERS is true
(but without actually checking it). This change follows that suggestion:
Squid no longer uses AC_HEADER_STDC and STDC_HEADERS.
A `#define STDC_HEADERS 1` line may still be present in generated
./configure because AC_USE_SYSTEM_EXTENSIONS places it there. However,
in Squid v5 ./configure, AC_USE_SYSTEM_EXTENSIONS only runs on Solaris.
----
This change contains a tiny portion of master/v6 commit
a1c2236, a
commit that does not disclose the assert() message fix and contains many
more changes (some of which needed fixups). That commit also did not
remove STDC_HEADERS from compat/GnuRegex.c.
Co-authored-by: Amos Jeffries <squid3@treenet.co.nz>
/* We used to test for `BSTRING' here, but only GCC and Emacs define
* `BSTRING', as far as I know, and neither of them use this code. */
-#if HAVE_STRING_H || STDC_HEADERS
+#if HAVE_STRING_H
#include <string.h>
#else
#include <strings.h>
#define assert(EX) ((void)0)
#elif defined(NODEBUG)
#define assert(EX) ((void)0)
-#elif STDC_HEADERS
-#define assert(EX) ((EX)?((void)0):xassert( # EX , __FILE__, __LINE__))
#else
-#define assert(EX) ((EX)?((void)0):xassert("EX", __FILE__, __LINE__))
+#define assert(EX) ((EX)?((void)0):xassert( # EX , __FILE__, __LINE__))
#endif
#ifdef __cplusplus
dnl Check for headers
AC_HEADER_DIRENT
-AC_HEADER_STDC
AC_CHECK_HEADERS( \
arpa/inet.h \
AC_CHECK_TYPE(socklen_t,AC_DEFINE(HAVE_SOCKLEN_T,1,[socklen_t is defined by the system headers]),,[
#include <sys/types.h>
#include <sys/socket.h>
-#if STDC_HEADERS
#include <stdlib.h>
#include <stddef.h>
-#endif])
+])
AC_CHECK_TYPE(mtyp_t,AC_DEFINE(HAVE_MTYP_T,1,
[mtyp_t is defined by the system headers]),,[#include <sys/types.h>
#define assert(EX) ((void)0)
#elif defined(NODEBUG)
#define assert(EX) ((void)0)
-#elif STDC_HEADERS
-#define assert(EX) ((EX)?((void)0):xassert( # EX , __FILE__, __LINE__))
#else
-#define assert(EX) ((EX)?((void)0):xassert("EX", __FILE__, __LINE__))
+#define assert(EX) ((EX)?((void)0):xassert( # EX , __FILE__, __LINE__))
#endif
/* context-based debugging, the actual type is subject to change */