Re: C23 support in Autoconf

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


On 4/30/24 10:51, Paul Eggert wrote:
I installed the attached patch into Savannah master to get the ball rolling on Autoconf supporting C23.

Most C23 compatibility gizmos are now done in Gnulib. However, Autoconf's AC_PROG_CC needs to be changed to tack --std=gnu23 onto $CC. Although this may cause a few backward compatibility hassles with ancient packages that still use K&R C functions, C23 means these packages need to be changed to use function prototypes anyway.

Just FYI, from my experiments building the X.Org packages (a code base that
still has many bits originally written before the C89 standard) with gcc 13.2
and --std=gnu23, the biggest source of problems was not function prototypes,
but the change of "true" and "false" to no longer be acceptable lvalues,
and of "bool" to be a builtin type.

Fortunately in our cases, the patches were small & simple:

but I know we're not alone here with these changes, even in much newer code:

Of course, our experience is somewhat biased by the XORG_COMPILER_FLAGS macro
in our xorg-macros.m4 set of autoconf macros having included
-Wold-style-definition in our default CFLAGS since 2011.

        -Alan Coopersmith-                 alan.coopersmith@xxxxxxxxxx
         Oracle Solaris Engineering -

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

  Powered by Linux