< DocKnot 3.05 | Russ Allbery > Eagle's Path > August 2020 | PGP::Sign 1.02 > |
In this release of my utility library for my other packages, I finally
decided to drop support for platforms without a working snprintf
.
This dates back to the early 2000s and a very early iteration of this
package. At the time, there were still some older versions of UNIX
without snprintf
at all. More commonly, it was buggy. The most
common problem was that it would return -1 if the buffer wasn't large
enough rather than returning the necessary size of the buffer. Or, in
some cases, it wouldn't support a buffer size of 0 and a NULL buffer to
get the necessary size.
At the time I added this support for INN and some other packages, Solaris
had several of these issues. But C99 standardized the correct
snprintf
behavior, and slowly every maintained operating system was
fixed. (I forget whether it was fixed in Solaris 8 or Solaris 9, but
regardless, Solaris has had a working snprintf
for many years.)
Meanwhile, the replacement function (Patrick Powell's version, also used
by mutt and other packages) was a huge wad of code and a corresponding
test suite. Over time, I've increased the aggressiveness of linters to
try to catch more dangerous C pitfalls, and that's required carrying more
and more small modifications plus a preamble to disable various warnings
that I didn't want to try to fix.
The straw that broke the camel's back was Clang's new case fallthrough
warning. Clang stopped supporting the traditional /* fallthrough
*/
comment. It now prefers [[clang:fallthrough]]
syntax, but of
course older compilers choke on that. It does support the GCC
__attribute__((__fallthrough__))
syntax, but older compilers don't
like that construction because they think it's an empty statement. It was
a mess, and I decided the time had come to drop this support effort.
At this point, if you're still running an operating system without C99
snprintf
, I think it's essentially a retrocomputing or at least
extremely stable legacy production situation, and you're unlikely to want
the latest and greatest releases of new software. Hopefully that
assumption is correct, or at least correct enough.
(I realize the right solution to this problem is probably for me to use Gnulib for portability. But converting to it is a whole other project with a lot of other implications and machinery, and I'm not sure that's what I want to spend time on.)
Also in this release is a fix for network tests on hosts with no IPv4 addresses (more on this when I release the next version of remctl), fixes for style issues found by Perl::Critic::Freenode, and some other test suite improvements.
You can get the latest version from the rra-c-util distribution page.
Posted: 2020-08-09 19:15 — Why no comments?
< DocKnot 3.05 | Russ Allbery > Eagle's Path > August 2020 | PGP::Sign 1.02 > |