autoconf
[Top][All Lists]
Advanced

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

Re: C99 support


From: Gary V. Vaughan
Subject: Re: C99 support
Date: Sun, 28 Nov 2004 21:26:08 +0000
User-agent: Mozilla Thunderbird 0.9 (Macintosh/20041103)

Kevin P. Fleming wrote:
Roger Leigh wrote:

and these work well.  What it doesn't do is let me use features such
as mixed declarations and code.  These require you to use "gcc
-std=c99" or "c99" or similar, and I can't enable this portably.  If
autoconf could find out how to put a given compiler into C99 mode,
that would be great (in the same way as AC_PROG_GCC_TRADITIONAL
works for K&R C).


This sort of test is also needed to test C99 support for anonymous unions and structures in declarators, which I have run into problems with before.

If there's a way to create AC_PROG_CC_C99 or something similar, that would be wonderful.

Armed with a list of the options required to put various compilers
into c99 mode, it would be quite straight forward to wrap an
implementation of AC_PROG_CC_C99 around libtool's internal
_LT_COMPILER_OPTION macro (which blindly tries a basic test compile
with the passed option and fails or succeeds on the exit status
of the compiler).  This is how libtool has been turning of rtti and
exceptions for a number of years:

 _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
   lt_cv_prog_compiler_rtti_exceptions,
   [-fno-rtti -fno-exceptions], [],
   [lt_no_builtin_flag="$lt_no_builtin_flag -fno-rtti -fno-exceptions"
 ])

HTH,
        Gary.
--
Gary V. Vaughan      ())_.  address@hidden,gnu.org}
Research Scientist   ( '/   http://tkd.kicks-ass.net
GNU Hacker           / )=   http://www.gnu.org/software/libtool
Technical Author   `(_~)_   http://sources.redhat.com/autobook

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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