From: Kevin Ryde Date: Sat, 21 Jun 2003 00:01:04 +0000 (+0000) Subject: (_AC_PROG_CC_STDC): Extend test program to get an X-Git-Tag: AUTOCONF-2.57b~51 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dc17cd9dac5ccb26df57a2e3a72dde17150376a2;p=thirdparty%2Fautoconf.git (_AC_PROG_CC_STDC): Extend test program to get an error from OSF 4.0 Compaq cc in its default almost-ANSI mode, thereby ensuring we add -std1 for full-ANSI. --- diff --git a/lib/autoconf/c.m4 b/lib/autoconf/c.m4 index 248bc644..a560562b 100644 --- a/lib/autoconf/c.m4 +++ b/lib/autoconf/c.m4 @@ -805,6 +805,16 @@ static char *f (char * (*g) (char **, int), char **p, ...) 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 don't provoke an error unfortunately, instead are silently treated + as 'x'. The following induces an error, until -std1 is added to get + proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an + array size at least. It's necessary to write '\x00'==0 to get something + that's true only with -std1. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; + int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);};