Hi.

I have a couple of questions about gnulib's support for the printf family.

1. Is the snprintf-posix module helpful in order to use the following 
portably?

  length = snprintf (NULL, 0, format, args);
  str = malloc (length + 1);
  snprintf (str, length + 1, format, args);

The snprintf man page warns of portability problems for the first snprintf 
invocation above, but snprintf-posix appears to test only vsnprintf's 
functionality for this purpose by invoking gl_VSNPRINTF_ZEROSIZE_C99.  Am 
I misunderstanding the module?  Is it assuming snprintf and vsnprintf will 
always manage to behave consistently in this respect?

2. Is there any single module that ensures portability of all *printf 
functions?  Or is it worthwhile to maintain a list of modules trimmed to 
exactly the functions that are currently used?

Thanks.


Reply via email to