[MacPorts] #62134: wget @1.21.1 does not build on PPC Leopard, Mac OS X 10.5.8, because of "error: 'for' loop initial declaration used outside C99 mode'"
MacPorts
noreply at macports.org
Mon Jan 25 15:04:07 UTC 2021
#62134: wget @1.21.1 does not build on PPC Leopard, Mac OS X 10.5.8, because of
"error: 'for' loop initial declaration used outside C99 mode'"
------------------------+------------------------
Reporter: ballapete | Owner: ryandesign
Type: defect | Status: closed
Priority: Normal | Milestone:
Component: ports | Version: 2.6.4
Resolution: fixed | Keywords: leopard
Port: wget |
------------------------+------------------------
Comment (by ballapete):
Replying to [comment:16 ryandesign]:
On PPC Tiger, Mac OS X 10.4.11 I can see:
{{{
checking for gcc... /opt/local/bin/gcc-apple-4.2
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 /opt/local/bin/gcc-apple-4.2 accepts -g... yes
checking for /opt/local/bin/gcc-apple-4.2 option to enable C11 features...
unsupported
checking for /opt/local/bin/gcc-apple-4.2 option to enable C99 features...
none needed
checking whether /opt/local/bin/gcc-apple-4.2 understands -c and -o
together... yes
checking whether the compiler is clang... no
checking for compiler option needed when checking for declarations... none
checking dependency style of /opt/local/bin/gcc-apple-4.2... gcc3
}}}
and in `config.log` this is recorded:
{{{
configure:5912: checking for /opt/local/bin/gcc-apple-4.2 option to enable
C11 features
configure:5927: /opt/local/bin/gcc-apple-4.2 -c -pipe -Os -arch ppc
-I/opt/local/include conftest.c >&5
conftest.c:63:3: error: #error "Compiler does not advertise C99
conformance"
conftest.c:118: error: expected ';', ',' or ')' before 'text'
conftest.c:167:3: error: #error "Compiler does not advertise C11
conformance"
conftest.c: In function '_Alignas':
conftest.c:171: error: expected declaration specifiers before
'aligned_as_double'
conftest.c:172: error: expected declaration specifiers or '...' before
numeric constant
conftest.c:172: error: expected '=', ',', ';', 'asm' or '__attribute__'
before 'no_special_alignment'
conftest.c:173: error: storage class specified for parameter
'aligned_as_int'
conftest.c:174: error: expected declaration specifiers or '...' before
numeric constant
conftest.c:174: error: expected '=', ',', ';', 'asm' or '__attribute__'
before '_Alignas'
conftest.c:179: error: expected expression before 'int'
conftest.c:179: error: enumerator value for 'int_alignment' is not an
integer constant
conftest.c:180: error: expected expression before 'int'
conftest.c:180: error: enumerator value for 'int_array_alignment' is not
an integer constant
conftest.c:181: error: expected expression before 'char'
conftest.c:182: error: enumerator value for 'char_alignment' is not an
integer constant
conftest.c:182: warning: empty declaration
conftest.c:183: error: expected declaration specifiers before
'_Static_assert'
conftest.c:186: error: expected '=', ',', ';', 'asm' or '__attribute__'
before 'does_not_return'
conftest.c:192: error: expected specifier-qualifier-list before
'_Static_assert'
conftest.c:195: warning: empty declaration
conftest.c:199: error: parameter 'utf8_literal' is initialized
conftest.c:199: error: 'syntax' undeclared (first use in this function)
conftest.c:199: error: (Each undeclared identifier is reported only once
conftest.c:199: error: for each function it appears in.)
conftest.c:199: error: expected ',' or ';' before 'error'
conftest.c:202: error: storage class specified for parameter 'long_ptr'
conftest.c:203: error: storage class specified for parameter 'long_ptr'
conftest.c:203: error: redefinition of parameter 'long_ptr'
conftest.c:202: error: previous definition of 'long_ptr' was here
conftest.c:204: error: expected '=', ',', ';', 'asm' or '__attribute__'
before 'long_ptr'
conftest.c:219: error: expected '=', ',', ';', 'asm' or '__attribute__'
before '{' token
conftest.c:271: error: old-style parameter declarations in prototyped
function definition
conftest.c:171: error: parameter name omitted
conftest.c:271: error: expected '{' at end of input
configure:5927: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "wget"
| #define PACKAGE_TARNAME "wget"
| #define PACKAGE_VERSION "1.21.1"
| #define PACKAGE_STRING "wget 1.21.1"
| #define PACKAGE_BUGREPORT "bug-wget at gnu.org"
| #define PACKAGE_URL ""
| #define PACKAGE "wget"
| #define VERSION "1.21.1"
| /* end confdefs.h. */
|
| /* Does the compiler advertise C89 conformance?
| Do not test the value of __STDC__, because some compilers set it to 0
| while being otherwise adequately conformant. */
| #if !defined __STDC__
| # error "Compiler does not advertise C89 conformance"
| #endif
|
| #include <stddef.h>
| #include <stdarg.h>
| struct stat;
| /* Most of the following tests are stolen from RCS 5.7 src/conf.sh. */
| struct buf { int x; };
| struct buf * (*rcsopen) (struct buf *, struct stat *, int);
| static char *e (p, i)
| char **p;
| int i;
| {
| return p[i];
| }
| static char *f (char * (*g) (char **, int), char **p, ...)
| {
| char *s;
| va_list v;
| va_start (v,p);
| s = g (p, va_arg (v,int));
| va_end (v);
| return s;
| }
|
| /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has
| function prototypes and stuff, but not \xHH hex character constants.
| These do not provoke an error unfortunately, instead are silently
treated
| as an "x". The following induces an error, until -std is added to
get
| proper ANSI mode. Curiously \x00 != x always comes out true, for an
| array size at least. It is necessary to write \x00 == 0 to get
something
| that is true only with -std. */
| int osf4_cc_array ['\x00' == 0 ? 1 : -1];
|
| /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro
parameters
| inside strings and character constants. */
| #define FOO(x) 'x'
| int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
|
| int test (int i, double x);
| struct s1 {int (*f) (int a);};
| struct s2 {int (*f) (double a);};
| int pairnames (int, char **, int *(*)(struct buf *, struct stat *, int),
| int, int);
|
| // Does the compiler advertise C99 conformance?
| #if !defined __STDC_VERSION__ || __STDC_VERSION__ < 199901L
| # error "Compiler does not advertise C99 conformance"
| #endif
|
| #include <stdbool.h>
| extern int puts (const char *);
| extern int printf (const char *, ...);
| extern int dprintf (int, const char *, ...);
| extern void *malloc (size_t);
|
| // Check varargs macros. These examples are taken from C99 6.10.3.5.
| // dprintf is used instead of fprintf to avoid needing to declare
| // FILE and stderr.
| #define debug(...) dprintf (2, __VA_ARGS__)
| #define showlist(...) puts (#__VA_ARGS__)
| #define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__))
| static void
| test_varargs_macros (void)
| {
| int x = 1234;
| int y = 5678;
| debug ("Flag");
| debug ("X = %d\n", x);
| showlist (The first, second, and third items.);
| report (x>y, "x is %d but y is %d", x, y);
| }
|
| // Check long long types.
| #define BIG64 18446744073709551615ull
| #define BIG32 4294967295ul
| #define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0)
| #if !BIG_OK
| #error "your preprocessor is broken"
| #endif
| #if BIG_OK
| #else
| #error "your preprocessor is broken"
| #endif
| static long long int bignum = -9223372036854775807LL;
| static unsigned long long int ubignum = BIG64;
|
| struct incomplete_array
| {
| int datasize;
| double data[];
| };
|
| struct named_init {
| int number;
| const wchar_t *name;
| double average;
| };
|
| typedef const char *ccp;
|
| static inline int
| test_restrict (ccp restrict text)
| {
| // See if C++-style comments work.
| // Iterate through items via the restricted pointer.
| // Also check for declarations in for loops.
| for (unsigned int i = 0; *(text+i) != '\0'; ++i)
| continue;
| return 0;
| }
|
| // Check varargs and va_copy.
| static bool
| test_varargs (const char *format, ...)
| {
| va_list args;
| va_start (args, format);
| va_list args_copy;
| va_copy (args_copy, args);
|
| const char *str = "";
| int number = 0;
| float fnumber = 0;
|
| while (*format)
| {
| switch (*format++)
| {
| case 's': // string
| str = va_arg (args_copy, const char *);
| break;
| case 'd': // int
| number = va_arg (args_copy, int);
| break;
| case 'f': // float
| fnumber = va_arg (args_copy, double);
| break;
| default:
| break;
| }
| }
| va_end (args_copy);
| va_end (args);
|
| return *str && number && fnumber;
| }
|
|
| // Does the compiler advertise C11 conformance?
| #if !defined __STDC_VERSION__ || __STDC_VERSION__ < 201112L
| # error "Compiler does not advertise C11 conformance"
| #endif
|
| // Check _Alignas.
| char _Alignas (double) aligned_as_double;
| char _Alignas (0) no_special_alignment;
| extern char aligned_as_int;
| char _Alignas (0) _Alignas (int) aligned_as_int;
|
| // Check _Alignof.
| enum
| {
| int_alignment = _Alignof (int),
| int_array_alignment = _Alignof (int[100]),
| char_alignment = _Alignof (char)
| };
| _Static_assert (0 < -_Alignof (int), "_Alignof is signed");
|
| // Check _Noreturn.
| int _Noreturn does_not_return (void) { for (;;) continue; }
|
| // Check _Static_assert.
| struct test_static_assert
| {
| int x;
| _Static_assert (sizeof (int) <= sizeof (long int),
| "_Static_assert does not work in struct");
| long int y;
| };
|
| // Check UTF-8 literals.
| #define u8 syntax error!
| char const utf8_literal[] = u8"happens to be ASCII" "another string";
|
| // Check duplicate typedefs.
| typedef long *long_ptr;
| typedef long int *long_ptr;
| typedef long_ptr long_ptr;
|
| // Anonymous structures and unions -- taken from C11 6.7.2.1 Example 1.
| struct anonymous
| {
| union {
| struct { int i; int j; };
| struct { int k; long int l; } w;
| };
| int m;
| } v1;
|
|
| int
| main (int argc, char **argv)
| {
| int ok = 0;
|
| ok |= (argc == 0 || f (e, argv, 0) != argv[0] || f (e, argv, 1) !=
argv[1]);
|
|
| // Check bool.
| _Bool success = false;
| success |= (argc != 0);
|
| // Check restrict.
| if (test_restrict ("String literal") == 0)
| success = true;
| char *restrict newvar = "Another string";
|
| // Check varargs.
| success &= test_varargs ("s, d' f .", "string", 65, 34.234);
| test_varargs_macros ();
|
| // Check flexible array members.
| struct incomplete_array *ia =
| malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10));
| ia->datasize = 10;
| for (int i = 0; i < ia->datasize; ++i)
| ia->data[i] = i * 1.234;
|
| // Check named initializers.
| struct named_init ni = {
| .number = 34,
| .name = L"Test wide string",
| .average = 543.34343,
| };
|
| ni.number = 58;
|
| int dynamic_array[ni.number];
| dynamic_array[0] = argv[0][0];
| dynamic_array[ni.number - 1] = 543;
|
| // work around unused variable warnings
| ok |= (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] ==
'x'
| || dynamic_array[ni.number - 1] != 543);
|
|
| _Static_assert ((offsetof (struct anonymous, i)
| == offsetof (struct anonymous, w.k)),
| "Anonymous union alignment botch");
| v1.i = 2;
| v1.w.k = 5;
| ok |= v1.i != 5;
|
| return ok;
| }
|
configure:5927: /opt/local/bin/gcc-apple-4.2 -std=gnu11 -c -pipe -Os -arch
ppc -I/opt/local/include conftest.c >&5
cc1: error: unrecognized command line option "-std=gnu11"
configure:5927: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "wget"
| #define PACKAGE_TARNAME "wget"
| #define PACKAGE_VERSION "1.21.1"
| #define PACKAGE_STRING "wget 1.21.1"
| #define PACKAGE_BUGREPORT "bug-wget at gnu.org"
| #define PACKAGE_URL ""
| #define PACKAGE "wget"
| #define VERSION "1.21.1"
| /* end confdefs.h. */
|
| /* Does the compiler advertise C89 conformance?
| Do not test the value of __STDC__, because some compilers set it to 0
| while being otherwise adequately conformant. */
| #if !defined __STDC__
| # error "Compiler does not advertise C89 conformance"
| #endif
|
| #include <stddef.h>
| #include <stdarg.h>
| struct stat;
| /* Most of the following tests are stolen from RCS 5.7 src/conf.sh. */
| struct buf { int x; };
| struct buf * (*rcsopen) (struct buf *, struct stat *, int);
| static char *e (p, i)
| char **p;
| int i;
| {
| return p[i];
| }
| static char *f (char * (*g) (char **, int), char **p, ...)
| {
| char *s;
| va_list v;
| va_start (v,p);
| s = g (p, va_arg (v,int));
| va_end (v);
| return s;
| }
|
| /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has
| function prototypes and stuff, but not \xHH hex character constants.
| These do not provoke an error unfortunately, instead are silently
treated
| as an "x". The following induces an error, until -std is added to
get
| proper ANSI mode. Curiously \x00 != x always comes out true, for an
| array size at least. It is necessary to write \x00 == 0 to get
something
| that is true only with -std. */
| int osf4_cc_array ['\x00' == 0 ? 1 : -1];
|
| /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro
parameters
| inside strings and character constants. */
| #define FOO(x) 'x'
| int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
|
| int test (int i, double x);
| struct s1 {int (*f) (int a);};
| struct s2 {int (*f) (double a);};
| int pairnames (int, char **, int *(*)(struct buf *, struct stat *, int),
| int, int);
|
| // Does the compiler advertise C99 conformance?
| #if !defined __STDC_VERSION__ || __STDC_VERSION__ < 199901L
| # error "Compiler does not advertise C99 conformance"
| #endif
|
| #include <stdbool.h>
| extern int puts (const char *);
| extern int printf (const char *, ...);
| extern int dprintf (int, const char *, ...);
| extern void *malloc (size_t);
|
| // Check varargs macros. These examples are taken from C99 6.10.3.5.
| // dprintf is used instead of fprintf to avoid needing to declare
| // FILE and stderr.
| #define debug(...) dprintf (2, __VA_ARGS__)
| #define showlist(...) puts (#__VA_ARGS__)
| #define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__))
| static void
| test_varargs_macros (void)
| {
| int x = 1234;
| int y = 5678;
| debug ("Flag");
| debug ("X = %d\n", x);
| showlist (The first, second, and third items.);
| report (x>y, "x is %d but y is %d", x, y);
| }
|
| // Check long long types.
| #define BIG64 18446744073709551615ull
| #define BIG32 4294967295ul
| #define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0)
| #if !BIG_OK
| #error "your preprocessor is broken"
| #endif
| #if BIG_OK
| #else
| #error "your preprocessor is broken"
| #endif
| static long long int bignum = -9223372036854775807LL;
| static unsigned long long int ubignum = BIG64;
|
| struct incomplete_array
| {
| int datasize;
| double data[];
| };
|
| struct named_init {
| int number;
| const wchar_t *name;
| double average;
| };
|
| typedef const char *ccp;
|
| static inline int
| test_restrict (ccp restrict text)
| {
| // See if C++-style comments work.
| // Iterate through items via the restricted pointer.
| // Also check for declarations in for loops.
| for (unsigned int i = 0; *(text+i) != '\0'; ++i)
| continue;
| return 0;
| }
|
| // Check varargs and va_copy.
| static bool
| test_varargs (const char *format, ...)
| {
| va_list args;
| va_start (args, format);
| va_list args_copy;
| va_copy (args_copy, args);
|
| const char *str = "";
| int number = 0;
| float fnumber = 0;
|
| while (*format)
| {
| switch (*format++)
| {
| case 's': // string
| str = va_arg (args_copy, const char *);
| break;
| case 'd': // int
| number = va_arg (args_copy, int);
| break;
| case 'f': // float
| fnumber = va_arg (args_copy, double);
| break;
| default:
| break;
| }
| }
| va_end (args_copy);
| va_end (args);
|
| return *str && number && fnumber;
| }
|
|
| // Does the compiler advertise C11 conformance?
| #if !defined __STDC_VERSION__ || __STDC_VERSION__ < 201112L
| # error "Compiler does not advertise C11 conformance"
| #endif
|
| // Check _Alignas.
| char _Alignas (double) aligned_as_double;
| char _Alignas (0) no_special_alignment;
| extern char aligned_as_int;
| char _Alignas (0) _Alignas (int) aligned_as_int;
|
| // Check _Alignof.
| enum
| {
| int_alignment = _Alignof (int),
| int_array_alignment = _Alignof (int[100]),
| char_alignment = _Alignof (char)
| };
| _Static_assert (0 < -_Alignof (int), "_Alignof is signed");
|
| // Check _Noreturn.
| int _Noreturn does_not_return (void) { for (;;) continue; }
|
| // Check _Static_assert.
| struct test_static_assert
| {
| int x;
| _Static_assert (sizeof (int) <= sizeof (long int),
| "_Static_assert does not work in struct");
| long int y;
| };
|
| // Check UTF-8 literals.
| #define u8 syntax error!
| char const utf8_literal[] = u8"happens to be ASCII" "another string";
|
| // Check duplicate typedefs.
| typedef long *long_ptr;
| typedef long int *long_ptr;
| typedef long_ptr long_ptr;
|
| // Anonymous structures and unions -- taken from C11 6.7.2.1 Example 1.
| struct anonymous
| {
| union {
| struct { int i; int j; };
| struct { int k; long int l; } w;
| };
| int m;
| } v1;
|
|
| int
| main (int argc, char **argv)
| {
| int ok = 0;
|
| ok |= (argc == 0 || f (e, argv, 0) != argv[0] || f (e, argv, 1) !=
argv[1]);
|
|
| // Check bool.
| _Bool success = false;
| success |= (argc != 0);
|
| // Check restrict.
| if (test_restrict ("String literal") == 0)
| success = true;
| char *restrict newvar = "Another string";
|
| // Check varargs.
| success &= test_varargs ("s, d' f .", "string", 65, 34.234);
| test_varargs_macros ();
|
| // Check flexible array members.
| struct incomplete_array *ia =
| malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10));
| ia->datasize = 10;
| for (int i = 0; i < ia->datasize; ++i)
| ia->data[i] = i * 1.234;
|
| // Check named initializers.
| struct named_init ni = {
| .number = 34,
| .name = L"Test wide string",
| .average = 543.34343,
| };
|
| ni.number = 58;
|
| int dynamic_array[ni.number];
| dynamic_array[0] = argv[0][0];
| dynamic_array[ni.number - 1] = 543;
|
| // work around unused variable warnings
| ok |= (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] ==
'x'
| || dynamic_array[ni.number - 1] != 543);
|
|
| _Static_assert ((offsetof (struct anonymous, i)
| == offsetof (struct anonymous, w.k)),
| "Anonymous union alignment botch");
| v1.i = 2;
| v1.w.k = 5;
| ok |= v1.i != 5;
|
| return ok;
| }
|
configure:5945: result: unsupported
configure:5958: checking for /opt/local/bin/gcc-apple-4.2 option to enable
C99 features
configure:5973: /opt/local/bin/gcc-apple-4.2 -c -pipe -Os -arch ppc
-I/opt/local/include conftest.c >&5
configure:5973: $? = 0
configure:5988: result: none needed
}}}
The `configure` script has:
{{{
5912 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC
option to enable C11 features" >&5
5913 printf %s "checking for $CC option to enable C11 features... "
>&6; }
5914 if test ${ac_cv_prog_cc_c11+y}
5915 then :
5916 printf %s "(cached) " >&6
5917 else $as_nop
5918 ac_cv_prog_cc_c11=no
5919 ac_save_CC=$CC
5920 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5921 /* end confdefs.h. */
5922 $ac_c_conftest_c11_program
5923 _ACEOF
5924 for ac_arg in '' -std=gnu11
5925 do
5926 CC="$ac_save_CC $ac_arg"
5927 if ac_fn_c_try_compile "$LINENO"
5928 then :
5929 ac_cv_prog_cc_c11=$ac_arg
5930 fi
5931 rm -f core conftest.err conftest.$ac_objext conftest.beam
5932 test "x$ac_cv_prog_cc_c11" != "xno" && break
5933 done
5934 rm -f conftest.$ac_ext
5935 CC=$ac_save_CC
5936
5937 fi
5938 # AC_CACHE_VAL
5939 ac_prog_cc_stdc_options=
5940 case "x$ac_cv_prog_cc_c11" in #(
5941 x) :
5942 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none
needed" >&5
5943 printf "%s\n" "none needed" >&6; } ;; #(
5944 xno) :
5945 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result:
unsupported" >&5
5946 printf "%s\n" "unsupported" >&6; } ;; #(
5947 *) :
5948 ac_prog_cc_stdc_options=" $ac_cv_prog_cc_c11"
5949 CC="$CC$ac_prog_cc_stdc_options"
5950 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result:
$ac_cv_prog_cc_c11" >&5
5951 printf "%s\n" "$ac_cv_prog_cc_c11" >&6; } ;;
5952 esac
5953 if test "x$ac_cv_prog_cc_c11" != xno
5954 then :
5955 ac_prog_cc_stdc=c11
5956 ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c11
5957 else $as_nop
5958 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC
option to enable C99 features" >&5
5959 printf %s "checking for $CC option to enable C99 features... "
>&6; }
5960 if test ${ac_cv_prog_cc_c99+y}
5961 then :
5962 printf %s "(cached) " >&6
5963 else $as_nop
5964 ac_cv_prog_cc_c99=no
5965 ac_save_CC=$CC
5966 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5967 /* end confdefs.h. */
5968 $ac_c_conftest_c89_program
5969 _ACEOF
5970 for ac_arg in '' -std=gnu99 -std=c99 -c99 -AC99 -D_STDC_C99=
-qlanglvl=extc1x -qlanglvl=extc99
5971 do
5972 CC="$ac_save_CC $ac_arg"
5973 if ac_fn_c_try_compile "$LINENO"
5974 then :
5975 ac_cv_prog_cc_c99=$ac_arg
5976 fi
5977 rm -f core conftest.err conftest.$ac_objext conftest.beam
5978 test "x$ac_cv_prog_cc_c99" != "xno" && break
5979 done
5980 rm -f conftest.$ac_ext
5981 CC=$ac_save_CC
5982
5983 fi
5984 # AC_CACHE_VAL
5985 ac_prog_cc_stdc_options=
5986 case "x$ac_cv_prog_cc_c99" in #(
5987 x) :
5988 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none
needed" >&5
5989 printf "%s\n" "none needed" >&6; } ;; #(
5990 xno) :
5991 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result:
unsupported" >&5
5992 printf "%s\n" "unsupported" >&6; } ;; #(
5993 *) :
5994 ac_prog_cc_stdc_options=" $ac_cv_prog_cc_c99"
5995 CC="$CC$ac_prog_cc_stdc_options"
5996 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result:
$ac_cv_prog_cc_c99" >&5
5997 printf "%s\n" "$ac_cv_prog_cc_c99" >&6; } ;;
5998 esac
5999 if test "x$ac_cv_prog_cc_c99" != xno
6000 then :
6001 ac_prog_cc_stdc=c99
6002 ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99
6003 else $as_nop
6004 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC
option to enable C89 features" >&5
6005 printf %s "checking for $CC option to enable C89 features... "
>&6; }
6006 if test ${ac_cv_prog_cc_c89+y}
6007 then :
6008 printf %s "(cached) " >&6
6009 else $as_nop
6010 ac_cv_prog_cc_c89=no
6011 ac_save_CC=$CC
6012 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6013 /* end confdefs.h. */
6014 $ac_c_conftest_c89_program
6015 _ACEOF
6016 for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
6017 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
6018 do
6019 CC="$ac_save_CC $ac_arg"
6020 if ac_fn_c_try_compile "$LINENO"
6021 then :
6022 ac_cv_prog_cc_c89=$ac_arg
6023 fi
6024 rm -f core conftest.err conftest.$ac_objext conftest.beam
6025 test "x$ac_cv_prog_cc_c89" != "xno" && break
6026 done
6027 rm -f conftest.$ac_ext
6028 CC=$ac_save_CC
6029
6030 fi
6031 # AC_CACHE_VAL
6032 ac_prog_cc_stdc_options=
6033 case "x$ac_cv_prog_cc_c89" in #(
6034 x) :
6035 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none
needed" >&5
6036 printf "%s\n" "none needed" >&6; } ;; #(
6037 xno) :
6038 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result:
unsupported" >&5
6039 printf "%s\n" "unsupported" >&6; } ;; #(
6040 *) :
6041 ac_prog_cc_stdc_options=" $ac_cv_prog_cc_c89"
6042 CC="$CC$ac_prog_cc_stdc_options"
6043 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result:
$ac_cv_prog_cc_c89" >&5
6044 printf "%s\n" "$ac_cv_prog_cc_c89" >&6; } ;;
6045 esac
6046 if test "x$ac_cv_prog_cc_c89" != xno
6047 then :
6048 ac_prog_cc_stdc=c89
6049 ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89
6050 else $as_nop
6051 ac_prog_cc_stdc=no
6052 ac_cv_prog_cc_stdc=no
6053 fi
6054
6055 fi
6056
6057 fi
}}}
To me it looks as if the wrong tests were performed for `C11` resp. `C99`.
`GCC 4.2` (`"4.2.4 (Apple Inc. build 5666) (dot 3) (MacPorts apple-gcc42
5666.3_16+gpl3)"`) defines `__STDC__` to `1` and does not define
`__STDC_VERSION__`. The correct options for this version of `GCC` are:
{{{
-std=c89 Conform to the ISO 1990 C standard
-std=c99 Conform to the ISO 1999 C standard
-std=c9x Deprecated in favor of -std=c99
-std=gnu89 Conform to the ISO 1990 C standard with GNU
extensions
-std=gnu99 Conform to the ISO 1999 C standard with GNU
extensions
-std=gnu9x Deprecated in favor of -std=gnu99
-std=iso9899:1990 Conform to the ISO 1990 C standard
-std=iso9899:199409 Conform to the ISO 1990 C standard as
amended in 1994
-std=iso9899:1999 Conform to the ISO 1999 C standard
-std=iso9899:199x Deprecated in favor of -std=iso9899:1999
-ansi A synonym for -std=c89 (for C) or -std=c++98
(for C++)
-std=c++98 Conform to the ISO 1998 C++ standard
-std=gnu++98 Conform to the ISO 1998 C++ standard with
GNU extensions
}}}
No modern C++ standard is supported.
--
Ticket URL: <https://trac.macports.org/ticket/62134#comment:17>
MacPorts <https://www.macports.org/>
Ports system for macOS
More information about the macports-tickets
mailing list