autoconf
[Top][All Lists]
Advanced

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

Re: No macro for C11/C18?


From: Nick Bowler
Subject: Re: No macro for C11/C18?
Date: Wed, 5 Feb 2020 10:56:46 -0500

On 2020-02-01, Andrew W. Nosenko <address@hidden> wrote:
> On Fri, Jan 24, 2020 at 9:48 PM Nick Bowler <address@hidden> wrote:
> > AC_PROG_CC now tries to select the highest language revision supported
> > by the compiler.
>
> These macros (AC_PROG_CC_C99 vs. new AC_PROG_CC) have different
> semantics.  AC_PROG_CC_C99 — select best/prefered compiler that
> supports particular standard (c99), while new AC_PROG_CC — select
> best/most recent standard supported by particular compiler.
>
> So deprecating one in favour of another is quite like deprecating
> apples in favour of oranges.

I think you are misunderstanding what AC_PROG_CC_C99 actually does.

It does not search for a compiler that supports C99.  It picks the
first compiler it finds in a list (or uses the compiler specified by
the user via CC), and then checks whether one of several options
are needed to enable support for C99.  This macro is best effort:
if the compiler it found only supports C89 then you get a C89 compiler,
or if the compiler supports C11 by default then you get a C11 compiler.

It is *exactly* the same as the new AC_PROG_CC, except that now these
macros will first try to find options that enable C11 before looking
for options that enable C99.  In practice there are probably not a
lot of compilers where this makes any difference at all (quite possibly
just gcc-4.7 through gcc-4.9 and maybe some very early versions of clang).

A C11 compiler can compile C99 code so there should be no portability
problem if a C11 compiler is selected for a package that requires C99
features.

Cheers,
  Nick



reply via email to

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