Re: heads up RE autoconf C23 vs legacy code
Greg Troxel <[email protected]> Thu, 02 Jul 2026 17:56:24 -0400
| Newsgroups | gmane.os.netbsd.devel.packages |
|---|---|
| Message-ID | <[email protected]> |
Tobias Nygren <[email protected]> writes: > On Thu, 02 Jul 2026 15:52:51 -0400 > Greg Troxel <[email protected]> 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.