[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] snprintf: port snprintf (NULL, 0, ...) to Solaris 8 and 9

From: Bruno Haible
Subject: Re: [PATCH] snprintf: port snprintf (NULL, 0, ...) to Solaris 8 and 9
Date: Tue, 21 Dec 2010 13:14:10 +0100
User-agent: KMail/1.9.9

Hi Paul,

> +       * m4/printf.m4 (gl_SNPRINTF_RETVAL_C99): Also check for
> +       snprintf (NULL, 0, ...) and (for good measure) snprintf (buf, 0, ...).

Thanks. Yet another *printf portability problem...

> * m4/snprintf.m4 (gl_FUNC_SNPRINTF): Also check gl_SNPRINTF_RETVAL_C99.

I disagree with this change: The module 'snprintf' was meant to merely
allow uses such as

   char buf[80];
   snprintf (buf, 80, some_wild_format, arguments);

If a user wants more from snprintf(), he needs to require 'snprintf-posix'.

The platforms on which this change introduces an snprintf() wrapper
although snprintf already exists are: Solaris 2.6..9, AIX 5.1, HP-UX 11,
IRIX 6.5, OSF/1 5.1.

coreutils already uses 'vasprintf-posix' and 'xprintf-posix'. It would
not bring in much more code to require also 'snprintf-posix'.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]