Being compliant to a POSIX version is, in the end, a property of the system and runtime configuration, possibly including environment variable settings. While there *have* been systems released that have provided *runtime* environments for multiple versions of standard, where the behavior of utilities was tightened by the newer standard to break that system's backward compatibility, I don't know of any Open Source systems that have gone the route of supporting that. (I recall using some version of Solaris 2.x where they documented that a compliant, uh, SUSv3, iirc, environment required setting PATH to include /usr/xpg3 (?) before certain other dirs, while a SUSv4(?) env required /usr/xpg4 before those same dirs. Or something like that; this was something like 25+ years ago.)
I feel the POSIX view on the C compiler and make utilities are kind of a "individually make sense, bad in practice" result: * POSIX has required incompatible changes to utility behavior (c.f. that Solaris xpg3/xpg4 thing) * ...but instead of specing a fixed name for the C compiler and then requiring it to behave to match the runtime environment in effect (perhaps because that would turn into "why don't we just specify 'cc' and fix/break the 'cc' option parsing behavior that everyone depends on" fight), they specified per-C-version binaries * but that then requires 'make' to change behavior, based on runtime environment! Maybe GNU make, after going into .POSIX mode, should invoke "getconf _POSIX2_VERSION" and set CC based on the output of that, falling back to c99 or whatever seems good at time of release. Will that make the most people happy, complying to the version which the rest of the base system is saying it complies with? Certainly seems better than complying with a standard that the base system does _not_ comply, resulting in 100% failed compiles when $(CC) doesn't exist... Philip Guenther On Sun, Nov 1, 2026 at 9:57 AM Brian Inglis <[email protected]> wrote: > > Hi folks, > > SUS V5 POSIX Issue 8 2024 sets CC=c17. > Simple patch to src/read.c is at bottom. > But you may want to decide if you are going to do anything with the changed > requirement about backward/forward compatibility? > Perhaps also support .POSIX2008 and .POSIX2024, default to former or latter? > > https://cgit.git.savannah.gnu.org/cgit/make.git/tree/src/read.c#n1899 > ... > check_specials (struct nameseq *files, int set_default) > ... > if (!posix_pedantic && streq (nm, ".POSIX")) > ... > /* These default values are based on IEEE Std 1003.1-2008. > It requires '-O 1' for [CF]FLAGS, but GCC doesn't allow > space between -O and the number so omit it here. */ > - define_variable_cname ("CC", "c99", o_default, 0); > + define_variable_cname ("CC", "c17", o_default, 0); > > -- > Take care. Thanks, Brian Inglis Calgary, Alberta, Canada > > La perfection est atteinte Perfection is achieved > non pas lorsqu'il n'y a plus rien à ajouter not when there is no more to add > mais lorsqu'il n'y a plus rien à retrancher but when there is no more to cut > -- Antoine de Saint-Exupéry >
