[RFC] Strftime return value when S is a null pointer

Ian Lance Taylor ian@wasabisystems.com
Fri Aug 20 16:09:00 GMT 2004


Paolo Carlini <pcarlini@suse.de> writes:

> I'm working on a libstdc++-v3 problem report. In order to fix it
> properly, I must
> be sure about the value returned by strftime when S is a null
> pointer. Indeed,
> according to the glibc docs
> 
>     "If S is a null pointer, `strftime' does not actually write
>      anything, but instead returns the number of characters it would
>      have written."
> 
> and this is rather nice (not nice as snprintf, but, anyway). The
> problem is that I
> cannot find in C99 anything *mandating* this specific behavior.
> 
> Is it a glibc specific feature? In case, as far as glibc is concerned,
> can we rely upon
> it for all the recent, current (and, likely, future) releases?

This behaviour would be glibc specific.  It is not true on NetBSD, for
example.

Ian



More information about the Libstdc++ mailing list