autoconf-patches
[Top][All Lists]
Advanced

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

Re: osf 4 cc versus _AC_PROG_CC_STDC


From: Akim Demaille
Subject: Re: osf 4 cc versus _AC_PROG_CC_STDC
Date: Thu, 12 Jun 2003 12:44:20 +0200
User-agent: Gnus/5.1002 (Gnus v5.10.2) Emacs/21.3 (gnu/linux)

|         * lib/autoconf/c.m4 (_AC_PROG_CC_STDC): Extend test program to get an
|         error from OSF 4.0 Compaq C in its default almost-ANSI mode, so that
|         we add -std1.
| 
| I'm hoping an expression like
| 
|       int osf4_cc_array ['\x00' == 0 ? 1 : -1];
| 
| can reasonably be expected to pass on all ansi compilers.  It's
| similar to the sizeof probes at least.
| 
| 
| --- c.m4.~1.179.~     2003-05-24 07:07:17.000000000 +1000
| +++ c.m4      2003-06-07 11:45:52.000000000 +1000
| @@ -805,6 +805,16 @@
|    va_end (v);
|    return s;
|  }
| +
| +/* OSF 4.0 Compaq C 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 for this, until -std1 is added to
| +   put it in proper ANSI mode.  Curiously '\x00'!='x' comes out true, it's
| +   necessary to write '\x00'==0 to induce a problem, for an array size at
| +   least.  */
| +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);};

This is good to me.




reply via email to

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