bug-autoconf
[Top][All Lists]
Advanced

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

[sr #110382] In autoconf-2.69d AC_LANG_SOURCE implicitly includes '#incl


From: Sergei Trofimovich
Subject: [sr #110382] In autoconf-2.69d AC_LANG_SOURCE implicitly includes '#include "confdefs.h"'
Date: Wed, 25 Nov 2020 02:53:33 -0500 (EST)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:83.0) Gecko/20100101 Firefox/83.0

URL:
  <https://savannah.gnu.org/support/?110382>

                 Summary: In autoconf-2.69d AC_LANG_SOURCE implicitly includes
'#include "confdefs.h"'
                 Project: Autoconf
            Submitted by: slyfox
            Submitted on: Ср 25 ноя 2020 07:53:31
                Category: None
                Priority: 5 - Normal
                Severity: 3 - Normal
                  Status: None
                 Privacy: Public
             Assigned to: None
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
        Operating System: None

    _______________________________________________________

Details:

I'm not sure if it's a bug or feature. Filing a bug to clarify. 

Initially bug is observed on apr-1.7.0 package:
https://bugs.gentoo.org/750353

Here is a small example extracted from apr source code at
https://github.com/apache/apr/blob/trunk/build/apr_common.m4#L508:


AC_PREREQ([2.59])

AC_INIT

dnl this seems to be the trigger:
AC_USE_SYSTEM_EXTENSIONS

CFLAGS="$CFLAGS -Werror"
AC_COMPILE_IFELSE(
  [AC_LANG_SOURCE(
   [#include "confdefs.h"
   int main(int argc, const char *const *argv) { return 0; }]
  )], [:], [AC_MSG_ERROR(Found warnings)])

AC_OUTPUT


Worked before as:


$ autoreconf-2.69 && ./configure --host=x86_64-pc-linux-gnu
checking for x86_64-pc-linux-gnu-gcc... x86_64-pc-linux-gnu-gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether x86_64-pc-linux-gnu-gcc accepts -g... yes
checking for x86_64-pc-linux-gnu-gcc option to accept ISO C89... none needed
checking how to run the C preprocessor... x86_64-pc-linux-gnu-gcc -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking minix/config.h usability... no
checking minix/config.h presence... no
checking for minix/config.h... no
checking whether it is safe to define __EXTENSIONS__... yes
configure: creating ./config.status


OK.

Fails now:


$ autoreconf-2.69d && ./configure --host=x86_64-pc-linux-gnu
checking for x86_64-pc-linux-gnu-gcc... x86_64-pc-linux-gnu-gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether the compiler supports GNU C... yes
checking whether x86_64-pc-linux-gnu-gcc accepts -g... yes
checking for x86_64-pc-linux-gnu-gcc option to enable C11 features... none
needed
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for minix/config.h... no
checking whether it is safe to define __EXTENSIONS__... yes
checking whether _XOPEN_SOURCE should be defined... no
configure: error: Found warnings


config.log says it happens because now "confdefs.h" is already included in
tests:


...
configure:3350: x86_64-pc-linux-gnu-gcc -c -g -O2 -Werror  conftest.c >&5
In file included from conftest.c:31:
confdefs.h:22: error: "__STDC_WANT_IEC_60559_ATTRIBS_EXT__" redefined
[-Werror]
   22 | #define __STDC_WANT_IEC_60559_ATTRIBS_EXT__ 1
      |
...
cc1: all warnings being treated as errors
configure:3350: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME ""
| #define PACKAGE_TARNAME ""
| #define PACKAGE_VERSION ""
| #define PACKAGE_STRING ""
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE_URL ""
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_SYS_STAT_H 1
| #define HAVE_STRINGS_H 1
| #define HAVE_INTTYPES_H 1
| #define HAVE_STDINT_H 1
| #define HAVE_UNISTD_H 1
| #define HAVE_STDLIB_H 1
| #define HAVE_STRING_H 1
| #define STDC_HEADERS 1
| #define __EXTENSIONS__ 1
| #define _ALL_SOURCE 1
| #define _DARWIN_C_SOURCE 1
| #define _GNU_SOURCE 1
| #define _POSIX_PTHREAD_SEMANTICS 1
| #define __STDC_WANT_IEC_60559_ATTRIBS_EXT__ 1
| #define __STDC_WANT_IEC_60559_BFP_EXT__ 1
| #define __STDC_WANT_IEC_60559_DFP_EXT__ 1
| #define __STDC_WANT_IEC_60559_FUNCS_EXT__ 1
| #define __STDC_WANT_IEC_60559_TYPES_EXT__ 1
| #define __STDC_WANT_LIB_EXT2__ 1
| #define __STDC_WANT_MATH_SPEC_FUNCS__ 1
| #define _TANDEM_SOURCE 1
| /* end confdefs.h.  */
| #include "confdefs.h"
|    int main(int argc, const char *const *argv) { return 0; }
|
configure:3354: error: Found warnings


I wonder if 'confdefs.h' would benefit from '#ifndef / #define / #endif'
guards.

Thank you!




    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/support/?110382>

_______________________________________________
  Сообщение отправлено по Savannah
  https://savannah.gnu.org/




reply via email to

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