public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/17038] New: ABI impacting issue in time_put
@ 2004-08-15 19:16 pcarlini at suse dot de
  2004-08-16  0:01 ` [Bug libstdc++/17038] " pinskia at gcc dot gnu dot org
                   ` (8 more replies)
  0 siblings, 9 replies; 12+ messages in thread
From: pcarlini at suse dot de @ 2004-08-15 19:16 UTC (permalink / raw)
  To: gcc-bugs

This is an internal reminder: most probably we have to change _M_put to return
an integer, otherwise we'll be never able to succesfully complete the output
when the buffer is too small (> 64 chars, currently).

These notes in the glibc docs about strftime (and wcsftime) will be useful 
in dealing correctly with the issue:

     The SIZE parameter can be used to specify the maximum number of
     characters to be stored in the array S, including the terminating
     null character.  If the formatted time requires more than SIZE
     characters, `strftime' returns zero and the contents of the array
     S are undefined.  Otherwise the return value indicates the number
     of characters placed in the array S, not including the terminating
     null character.

     _Warning:_ This convention for the return value which is prescribed
     in ISO C can lead to problems in some situations.  For certain
     format strings and certain locales the output really can be the
     empty string and this cannot be discovered by testing the return
     value only.  E.g., in most locales the AM/PM time format is not
     supported (most of the world uses the 24 hour time
     representation).  In such locales `"%p"' will return the empty
     string, i.e., the return value is zero.  To detect situations like
     this something similar to the following code should be used:

         buf[0] = '\1';
          len = strftime (buf, bufsize, format, tp);
          if (len == 0 && buf[0] != '\0')
            {
              /* Something went wrong in the strftime call.  */
              ...
            }

     If S is a null pointer, `strftime' does not actually write
     anything, but instead returns the number of characters it would
     have written.

-- 
           Summary: ABI impacting issue in time_put
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: libstdc++
        AssignedTo: pcarlini at suse dot de
        ReportedBy: pcarlini at suse dot de
                CC: gcc-bugs at gcc dot gnu dot org
  GCC host triplet: Any


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17038


^ permalink raw reply	[flat|nested] 12+ messages in thread
[parent not found: <bug-17038-133@http.gcc.gnu.org/bugzilla/>]
[parent not found: <bug-17038-16141@http.gcc.gnu.org/bugzilla/>]

end of thread, other threads:[~2010-01-06 11:57 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-08-15 19:16 [Bug libstdc++/17038] New: ABI impacting issue in time_put pcarlini at suse dot de
2004-08-16  0:01 ` [Bug libstdc++/17038] " pinskia at gcc dot gnu dot org
2004-08-25 23:38 ` cvs-commit at gcc dot gnu dot org
2004-08-27 13:30 ` cvs-commit at gcc dot gnu dot org
2004-08-28 19:23 ` cvs-commit at gcc dot gnu dot org
2004-08-29  0:49 ` pinskia at gcc dot gnu dot org
2004-08-29  8:49 ` pcarlini at suse dot de
2004-12-02  2:11 ` pinskia at gcc dot gnu dot org
2004-12-02  9:29 ` pcarlini at suse dot de
2004-12-08 23:31 ` pcarlini at suse dot de
     [not found] <bug-17038-133@http.gcc.gnu.org/bugzilla/>
2005-12-10  4:02 ` pinskia at gcc dot gnu dot org
     [not found] <bug-17038-16141@http.gcc.gnu.org/bugzilla/>
2010-01-06 11:57 ` paolo dot carlini at oracle dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).