On 2024-08-05 12:22, Paul Smith wrote:
On Mon, 2024-08-05 at 01:59 -0700, Paul Eggert wrote:
The first three patches are minor cleanups.

Is it the case that we can rely on all systems providing correct
sprintf() return values these days?  ISTR that some C runtime
implementations didn't correctly return the formatted length.

Good memory! 7th Edition Unix sprintf returned char *, and some distros did that long ago; the last survivor was SunOS 4, supported by Sun until 2003. However, C89 required sprintf to return int and those old implementations are long dead. Among other things the Autoconf manual says the ancient char *sprintf systems no longer need to be worried about <https://www.gnu.org/savannah-checkouts/gnu/autoconf/manual/autoconf-2.72/html_node/Function-Portability.html>.

ar_member_touch already relies on snprintf returning a byte count, so this isn't a new issue and regardless of whether this patch is accepted, GNU Make should either (a) not worry about porting to SunOS 4, (b) rewrite ar_member_touch to not use snprintf, or (c) import Gnulib's snprintf module which unfortunately is pretty heavyweight. I vote for (a).


Reply via email to