autoconf
[Top][All Lists]
Advanced

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

Re: Selecting a C++ standard


From: Roger Leigh
Subject: Re: Selecting a C++ standard
Date: Sat, 27 Oct 2012 22:47:50 +0100
User-agent: Mutt/1.5.21 (2010-09-15)

On Sat, Oct 27, 2012 at 01:55:58PM -0700, Paul Eggert wrote:
> On 10/27/2012 01:38 PM, Roger Leigh wrote:
> > Is anyone working on such a thing?
> 
> Not that I know of.
> 
> For C, we're deprecating the "I want version X"
> macros in favor of just AC_PROG_CC_STDC, which says
> "I want the latest version".  You might want to do
> that for C++ to, as it's more the Autoconf Way.

I agree that having AC_PROG_CC_STDC select the latest version is a
sensible default.

However, what do I do if I am making use of C99 features?  It
will probably fail if I'm using a feature that's not in a
traditional or C89 compiler.  But what if it's more subtle, if I'm
relying on a behaviour change in C99, and it compiles (but
incorrectly with C89)?  In this case, I would much rather tell
autoconf that I require a C99 compiler, and have it fail with
a useful error message during configure, rather than fail
during compilation or runtime with some unpredicable/obscure
error.

Maybe have an optional argument to AC_PROG_CC_STDC to select
the standard e.g.
  AC_PROG_CC_STDC([C99])
?

I originally wrote AC_PROC_CC_C99 because it was several years
since GCC supported C99, but there was no portable way to use
C99 features with projects using autoconf unless you added
horrible hacks.  We still have this situation for C++, and it
would be nice to solve it in a similar way to C.  I'm happy to
go with the new approach of a single macro, but I would be
interested to understand how the issues I outlined above square
with this.


Regards,
Roger

-- 
  .''`.  Roger Leigh
 : :' :  Debian GNU/Linux    http://people.debian.org/~rleigh/
 `. `'   schroot and sbuild  http://alioth.debian.org/projects/buildd-tools
   `-    GPG Public Key      F33D 281D 470A B443 6756 147C 07B3 C8BC 4083 E800



reply via email to

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