tech-pkg archive

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

Re: heads up RE autoconf C23 vs legacy code



Tobias Nygren <tnn%NetBSD.org@localhost> writes:

> On Thu, 02 Jul 2026 15:52:51 -0400
> Greg Troxel <gdt%lexort.com@localhost> wrote:
>
>> I think that's figuring out how to patch scmcvs's configure.in to ask
>> for C99.  Or maybe it's in c89.
>
> I found a somewhat reasonable workaround that does not require a patch:
>
> CONFIGURE_ENV+=		ac_cv_prog_cc_c23=no
>
> I will commit that unless there are better ideas.
> The obvious drawback is we will have to add ac_cv_prog_cc_c29=no as well
> a few years down the road.

If you are using a compiler that defaults to C23, I guess that works
because when autoconf sets --std=c17, gcc14 won't interpret the program
as C23.

I think it's better to do this, than to use FORCE_C_STD.


I wonder if there's a reasonable way to say

  if GNU_CONFIGURE and does_not_contain(USE_C_FEATURES, c23|gnu23)
    add CONFIGURE_ENV+= ac_cv_prog_cc_c23=no

that is ok in both clarity/awkwardness and runtime cost.  We can than
add c29 when the time comes, and c11/c17 if needed.





Home | Main Index | Thread Index | Old Index