Russ Allbery wrote:
John Spencer <maillist-autoconf@xxxxxxxxxxx> writes:
having an option like --assume-c99 could provide a shortcut so all
checks like
- have stdint.h
- have snprintf()
- etc
These are un-alike, just to mention. A surprising number of platforms
have an snprintf function that's broken. To test it properly, you need
something akin to the gnulib snprintf check, and it's broken in enough
places that you may not want to assume the result.
Some of the problems with snprintf are also quite serious. For example,
Solaris 9 (which I believe is otherwise C99-conforming) would return -1
when given NULL, 0 as the first arguments to snprintf, which makes it
impossible to use snprintf safely in many programs.
See:
https://www.gnu.org/software/gnulib/manual/html_node/snprintf.html
for more information about the portability mess.
point taken, although all the platforms described there are not exactly
what i would call modern, my leaning would be more towards calling them
broken, obsolete or simply undead.
<thinking_loud>
i even ask myself sometimes if it is still worth plastering software and
configure scripts with checks and ifdefs for these broken platforms that
probably cant even build the dependencies of modern software (these
ifdefs are almost always completely unmaintained due to lack of testing
and very likely to fail), and even if they still compile *and* work
there, are probably not even used.
because the handful of people using these platforms stick to their
current versions anyway...
speaking of it, it may be a good test to revive one of these zombie OS's
trying to do a full build of the 500 most popular non-linux-specific
packages in debian to proof that probably less than 10% will compile
despite extensive platform-specific hacks and workarounds.
carrying around all this legacy baggage is kinda like porting a 16bit
DOS program to win 3.11, then to win95, 98, xp, 7, 8 and still keeping
all the old 16bit code in #ifdefs without testing it ever.
btw, to this day i've yet to see a library or program, that for example
checks for unistd.h, and then uses HAVE_UNISTD_H consequently in all
TUs, including optional usage of any of its exported functions.
this probably worked once, when the initial autoconf support was written
and tested, but the next developer that came along just used unistd.h
without any conditionals...
</thinking_loud>
note that my suggestion is not to default to this shortcut, it's meant
to be used by users that know that their platform is fully compliant,
so it wouldnt affect users of these systems.
but maybe to make it more clear, the option should be called
--assume-c99-compliance instead.
--JS
_______________________________________________
Autoconf mailing list
Autoconf@xxxxxxx
https://lists.gnu.org/mailman/listinfo/autoconf