autoconf
[Top][All Lists]
Advanced

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

Re: C99 support


From: Roger Leigh
Subject: Re: C99 support
Date: Mon, 29 Nov 2004 21:59:45 +0000
User-agent: Gnus/5.1007 (Gnus v5.10.7) Emacs/21.3 (gnu/linux)

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Bob Friesenhahn <address@hidden> writes:

> On Mon, 29 Nov 2004, Roger Leigh wrote:
>>>
>>> Do you have a purpose for using C99 other than to intentionally write
>>> non-portable software?
>>
>> Yes: I would like to use C99 features, and the current autoconf
>> support isn't adequate.  I can portably make use of _Bool, inline and
>> restrict, but that's it.  The things I currently use, or would like to
>> use, are:
>>
>> - - C++-style comments
>> - - long long
>> - - Mixed declarations and code
>> - - Declarations in for loops.
>> - - Named Initialisers for structs
>>
>> None of these are strictly /necessary/, but I do believe the latter
>> three do make for cleaner, more maintainable code.
>
> For sure many C99 features make for cleaner, more maintainable code,
> but vendors are moving very slowly toward it (user demand seems low),
> and users need to upgrade their compilers when compliant compilers are
> available, so use of C99 features will certainly reduce portability of
> your code for the next couple of years.

Acknowledged.  Currently, most of the free software I write ends up
running on either GNU/Linux, *BSD, Darwin/MaxOSX or Solaris.  All but
the latter use GCC, and Solaris CC does support some C99 I believe.
So for my purposes, I should be OK using C99 provided the systems were
relatively up-to-date.

> For many years (8?, 10?), open source software continued to use K&R
> syntax or provide translators to K&R syntax, after the original ANSI C
> standard was solidified.  This should give you some idea how glacial
> the tool-base is.

Yes.

So would something like my proposed AC_PROG_CC_C99 macro be good as a
start?  It would be optional, and simply check if a compiler
previously found with AC_PROG_CC can be put into a C99 mode.  This
would be good for what I want--a portable way to get a C99 compiler,
and would be useful for others as well.

> The use of C++-style comments in open source C code is suspect. IBM's
> AIX C compiler does not support them.

But it's not a C99 compiler, is it? ;-)


Regards,
Roger

- -- 
Roger Leigh
                Printing on GNU/Linux?  http://gimp-print.sourceforge.net/
                Debian GNU/Linux        http://www.debian.org/
                GPG Public Key: 0x25BFB848.  Please sign and encrypt your mail.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (GNU/Linux)
Comment: Processed by Mailcrypt 3.5.8 <http://mailcrypt.sourceforge.net/>

iD0DBQFBq5vPVcFcaSW/uEgRAppYAJ9QNu062ipz2xKgd9tWQlX9k2KFzwCPewxW
+80auncUctY59JfWNifg
=mW0Y
-----END PGP SIGNATURE-----




reply via email to

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