Re: C23 support in Autoconf

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

 



On Tue, Apr 30, 2024, at 2:53 PM, Paul Eggert wrote:
> On 2024-04-30 11:49, Zack Weinberg wrote:
>> I think we ought to prioritize giving
>> package authors a way to control which edition of the C standard AC_PROG_CC
>> will select, rather than just always using the most recent one we know about.
>
> Yes, we could add a new macro to do that, or a new argument to 
> AC_PROG_CC. Presumably it would have to be called very early.

I think a new macro would be more self-documenting and also wouldn't
interfere with the dozens of macros that AC_REQUIRE AC_PROG_CC.  Something
like

AC_C_STANDARD_EDITION([2011])
AC_PROG_CC

We could also offer

AC_C_STANDARD_EDITION([2011], [strict])

to enable use of -std=cXX instead of -std=gnuXX, or equivalent.

> Although the new keywords and the lack of K&R support is a problem, it's 
> a problem people will have anyway as C23 spreads. So a new macro (or new 
> argument) would merely be a backward compatibility hack for people who 
> for some reason can't fix their old code, and the hack should be 
> documented with that in mind.

Another reason to want this type of control is if you are deliberately trying
to ensure that your code continues to compile with old compilers.  IIRC
the PostgreSQL people wanted this.  See <https://savannah.gnu.org/support/?110286>.

zw




[Index of Archives]     [GCC Help]     [Kernel Discussion]     [RPM Discussion]     [Red Hat Development]     [Yosemite News]     [Linux USB]     [Samba]

  Powered by Linux