[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: C23 support in Autoconf
From: |
Zack Weinberg |
Subject: |
Re: C23 support in Autoconf |
Date: |
Tue, 30 Apr 2024 15:03:43 -0400 |
User-agent: |
Cyrus-JMAP/3.11.0-alpha0-416-g2c1796742e-fm-20240424.001-g2c179674 |
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
- C23 support in Autoconf, Paul Eggert, 2024/04/30
- Re: C23 support in Autoconf, Alan Coopersmith, 2024/04/30
- Re: C23 support in Autoconf, Paul Eggert, 2024/04/30
- Re: C23 support in Autoconf, Zack Weinberg, 2024/04/30
- Re: C23 support in Autoconf, Paul Eggert, 2024/04/30
- Re: C23 support in Autoconf,
Zack Weinberg <=
- Re: C23 support in Autoconf, Paul Eggert, 2024/04/30
- Re: C23 support in Autoconf, Alan Coopersmith, 2024/04/30
- Re: C23 support in Autoconf, Antonin Décimo, 2024/04/30
- Re: C23 support in Autoconf, Jacob Bachmeyer, 2024/04/30