Joe Nelson <[email protected]> wrote:
> I noticed that OpenBSD lacks the POSIX "c99" compiler wrapper.
> https://pubs.opengroup.org/onlinepubs/9699919799/utilities/c99.html
>
> Is it missing because the community feels it's ill conceived, or just
> because nobody stepped up to implement it? If the latter, I can
> contribute a patch to add it as a wrapper around cc.
I think it is beyond ridiculous to attempt to standarize ("require")
a command called c99, when the command "cc" is not documented...
unless one realizes the commitee has become too happy at inventing new,
rather than following their charter which is largely documenting
established practice and negotiating simplification of differences where
possible. Instead, the commitee increasingly tosses shit like this into
"the standard" when some of them realize their futility as
"documentation writers" rather than large-system-progremamers, they know
they cannot re-specify the things people actually use (meaning, cc, with
tons of options), as those complicated subsystems follow a blend of
defacto-standards and per-team design. "cc" commandline options has little
in common with "ls", "cat", or "poll" (which I mention, because these
committees screwed up poll by underspecifying it RATHER than negotiating
simplification).
The people who pushed for this should retract this specification, mostlyn
because the proposal is stupid, will not be adopted by everyone, will
be considered a laughing stock as time goes on, and they will look smart
if they pull it.
How did this come to be? This is how, I think: Noone gave POSIX the
rope to specify new things, and "cc9" commandline is precisely the type
of thing which is new (because noone has these precise options) and
immediately old (all the compilers have more than these options, and
people use the other options more than the listed ones). The commitee
was not established as inventors, but as documentors & helpful purifiers
of "established standards over a range of systems". This kind of page
is is neither.
So, the c99 standard isn't just ill conceived. It is scope creep
outside the purview of the commitee, and downstreams must reject it to
remind them of their role & position in the operating system ecosystem.
> A few questions about the desired behavior:
>
> * If the user passes options not listed by POSIX, should the wrapper
> die with a usage error, or pass them silently to the underlying
> compiler? The FreeBSD implementation [0] does strict checking, while
> NetBSD [1] and GCC on Debian [2] pass along all parameters.
>
> * Should it add -pedantic as well as -std=c99?
>
> * Is /usr/bin/c99 something that should go in OpenBSD base, or in
> compiler ports?
>
> 0: https://github.com/freebsd/freebsd-src/blob/main/usr.bin/c99/c99.c
> 1: https://github.com/NetBSD/src/blob/trunk/usr.bin/c99/c99.sh
> 2: https://salsa.debian.org/toolchain-team/gcc-defaults/-/blob/master/c99
>