On Wed, Feb 5, 2020 at 5:56 PM Nick Bowler <nbowler@xxxxxxxxxx> wrote: > On 2020-02-01, Andrew W. Nosenko <andrew.w.nosenko@xxxxxxxxx> wrote: > > On Fri, Jan 24, 2020 at 9:48 PM Nick Bowler <nbowler@xxxxxxxxxx> 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. > I wonder not about obtaining c11 mode instead of c99. I wonder to obtain c89. Under AC_PROG_CC_C99 I can check ac_cv_prog_cc_c99. But what to check under floating AC_PROG_CC? (Current AC_PROG_CC_STDC has similar semantics — tries to set highest possible standard. And useless. Because says only one thing: yes, some compiler found, and it supports some (unspecified) standard). -- Andrew W. Nosenko <andrew.w.nosenko@xxxxxxxxx>