autoconf
[Top][All Lists]
Advanced

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

Re: Selecting a C++ standard


From: Paul Eggert
Subject: Re: Selecting a C++ standard
Date: Tue, 30 Oct 2012 10:34:27 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:16.0) Gecko/20121016 Thunderbird/16.0.1

On 10/30/2012 09:11 AM, Adrian Bunk wrote:
> if your example program would be built using autoconf, it would 
> behave differently depending on the autoconf version used.

Yes, it's possible to write C89 programs that silently
change meaning if compiled with C99.  Here's an other example,
which I gave in September:

    int N = (1//* this sets N to 1 in C99, and to 0 in C89.  Ouch?^!#*/-2
             + (INT_MAX < INT_MIN));

But these examples are contrived, and are not likely to happen
in real code.  If these are all we have to worry about, there's
no significant risk in defaulting to the latest standard.

Things were much riskier 20 years ago, because C89 *did*
introduce incompatible changes that broke existing apps.
But back then Autoconf was already in the "let's use the latest
version" camp: its AC_PROG_CC macro defaulted to C89, even though
this was risky.  It makes sense to continue to default to the
latest version, especially since it's less risky now.



reply via email to

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