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
* [Bug libstdc++/17038] ABI impacting issue in time_put
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 ` pinskia at gcc dot gnu dot org
2004-08-25 23:38 ` cvs-commit at gcc dot gnu dot org
` (7 subsequent siblings)
8 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-08-16 0:01 UTC (permalink / raw)
To: gcc-bugs
--
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |ASSIGNED
Ever Confirmed| |1
Last reconfirmed|0000-00-00 00:00:00 |2004-08-16 00:01:10
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17038
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug libstdc++/17038] ABI impacting issue in time_put
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
` (6 subsequent siblings)
8 siblings, 0 replies; 12+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2004-08-25 23:38 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From cvs-commit at gcc dot gnu dot org 2004-08-25 23:38 -------
Subject: Bug 17038
CVSROOT: /cvs/gcc
Module name: gcc
Changes by: paolo@gcc.gnu.org 2004-08-25 23:38:29
Modified files:
libstdc++-v3 : ChangeLog
libstdc++-v3/config/locale/gnu: time_members.cc
libstdc++-v3/config/locale/generic: time_members.cc
libstdc++-v3/include/bits: locale_facets.h locale_facets.tcc
Added files:
libstdc++-v3/testsuite/22_locale/time_put/put/char: 17038.cc
libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t: 17038.cc
Log message:
2004-08-25 Paolo Carlini <pcarlini@suse.de>
PR libstdc++/17038 (partial)
* include/bits/locale_facets.tcc (time_put<>::do_put): Increase
__maxlen to 128.
* include/bits/locale_facets.h (class __timepunct): Add FIXME
comment about _M_put.
* config/locale/generic/time_members.cc (_M_put): Always null
terminate __s.
* config/locale/gnu/time_members.cc (_M_put): Likewise.
* testsuite/22_locale/time_put/put/char/17038.cc: New.
* testsuite/22_locale/time_put/put/wchar_t/17038.cc: New.
Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/ChangeLog.diff?cvsroot=gcc&r1=1.2640&r2=1.2641
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/config/locale/gnu/time_members.cc.diff?cvsroot=gcc&r1=1.14&r2=1.15
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/config/locale/generic/time_members.cc.diff?cvsroot=gcc&r1=1.10&r2=1.11
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/include/bits/locale_facets.h.diff?cvsroot=gcc&r1=1.95&r2=1.96
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/include/bits/locale_facets.tcc.diff?cvsroot=gcc&r1=1.201&r2=1.202
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/testsuite/22_locale/time_put/put/char/17038.cc.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/17038.cc.diff?cvsroot=gcc&r1=NONE&r2=1.1
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17038
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug libstdc++/17038] ABI impacting issue in time_put
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
` (5 subsequent siblings)
8 siblings, 0 replies; 12+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2004-08-27 13:30 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From cvs-commit at gcc dot gnu dot org 2004-08-27 13:29 -------
Subject: Bug 17038
CVSROOT: /cvs/gcc
Module name: gcc
Branch: hammer-3_3-branch
Changes by: paolo@gcc.gnu.org 2004-08-27 13:29:52
Modified files:
libstdc++-v3 : ChangeLog.hammer
libstdc++-v3/include/bits: locale_facets.tcc
libstdc++-v3/config/locale/generic: time_members.cc
libstdc++-v3/config/locale/gnu: time_members.cc
Log message:
2004-08-27 Paolo Carlini <pcarlini@suse.de>
PR libstdc++/17038 (partial)
* include/bits/locale_facets.tcc (time_put<>::do_put): Increase
__maxlen to 128.
* config/locale/generic/time_members.cc (_M_put): Always null
terminate __s.
* config/locale/gnu/time_members.cc (_M_put): Likewise.
Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/ChangeLog.hammer.diff?cvsroot=gcc&only_with_tag=hammer-3_3-branch&r1=1.1.2.42&r2=1.1.2.43
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/include/bits/locale_facets.tcc.diff?cvsroot=gcc&only_with_tag=hammer-3_3-branch&r1=1.82.2.27&r2=1.82.2.28
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/config/locale/generic/time_members.cc.diff?cvsroot=gcc&only_with_tag=hammer-3_3-branch&r1=1.5.2.3&r2=1.5.2.4
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/config/locale/gnu/time_members.cc.diff?cvsroot=gcc&only_with_tag=hammer-3_3-branch&r1=1.8.2.2&r2=1.8.2.3
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17038
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug libstdc++/17038] ABI impacting issue in time_put
2004-08-15 19:16 [Bug libstdc++/17038] New: ABI impacting issue in time_put pcarlini at suse dot de
` (2 preceding siblings ...)
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
` (4 subsequent siblings)
8 siblings, 0 replies; 12+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2004-08-28 19:23 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From cvs-commit at gcc dot gnu dot org 2004-08-28 19:23 -------
Subject: Bug 17038
CVSROOT: /cvs/gcc
Module name: gcc
Branch: gcc-3_4-branch
Changes by: paolo@gcc.gnu.org 2004-08-28 19:23:35
Modified files:
libstdc++-v3 : ChangeLog
libstdc++-v3/config/locale/generic: time_members.cc
libstdc++-v3/config/locale/gnu: time_members.cc
libstdc++-v3/include/bits: locale_facets.tcc
Added files:
libstdc++-v3/testsuite/22_locale/time_put/put/char: 17038.cc
libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t: 17038.cc
Log message:
2004-08-28 Paolo Carlini <pcarlini@suse.de>
PR libstdc++/17038 (partial)
* include/bits/locale_facets.tcc (time_put<>::do_put): Increase
__maxlen to 128.
* config/locale/generic/time_members.cc (_M_put): Always null
terminate __s.
* config/locale/gnu/time_members.cc (_M_put): Likewise.
* testsuite/22_locale/time_put/put/char/17038.cc: New.
* testsuite/22_locale/time_put/put/wchar_t/17038.cc: New.
Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.2224.2.167&r2=1.2224.2.168
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/config/locale/generic/time_members.cc.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.9.12.1&r2=1.9.12.2
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/config/locale/gnu/time_members.cc.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.12.10.1&r2=1.12.10.2
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/include/bits/locale_facets.tcc.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.166.2.16&r2=1.166.2.17
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/testsuite/22_locale/time_put/put/char/17038.cc.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=NONE&r2=1.1.2.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/17038.cc.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=NONE&r2=1.1.2.1
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17038
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug libstdc++/17038] ABI impacting issue in time_put
2004-08-15 19:16 [Bug libstdc++/17038] New: ABI impacting issue in time_put pcarlini at suse dot de
` (3 preceding siblings ...)
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
` (3 subsequent siblings)
8 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-08-29 0:49 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2004-08-29 00:49 -------
Fixed.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |FIXED
Target Milestone|--- |3.4.2
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17038
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug libstdc++/17038] ABI impacting issue in time_put
2004-08-15 19:16 [Bug libstdc++/17038] New: ABI impacting issue in time_put pcarlini at suse dot de
` (4 preceding siblings ...)
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
` (2 subsequent siblings)
8 siblings, 0 replies; 12+ messages in thread
From: pcarlini at suse dot de @ 2004-08-29 8:49 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pcarlini at suse dot de 2004-08-29 08:49 -------
Not really fixed: as the summary says, a complete fix affects the library ABI
and we don't want that for 3.4.x and 3.5.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|RESOLVED |REOPENED
Resolution|FIXED |
Target Milestone|3.4.2 |---
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17038
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug libstdc++/17038] ABI impacting issue in time_put
2004-08-15 19:16 [Bug libstdc++/17038] New: ABI impacting issue in time_put pcarlini at suse dot de
` (5 preceding siblings ...)
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
8 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-12-02 2:11 UTC (permalink / raw)
To: gcc-bugs
--
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|pcarlini at suse dot de |unassigned at gcc dot gnu
| |dot org
Status|REOPENED |NEW
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17038
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug libstdc++/17038] ABI impacting issue in time_put
2004-08-15 19:16 [Bug libstdc++/17038] New: ABI impacting issue in time_put pcarlini at suse dot de
` (6 preceding siblings ...)
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
8 siblings, 0 replies; 12+ messages in thread
From: pcarlini at suse dot de @ 2004-12-02 9:29 UTC (permalink / raw)
To: gcc-bugs
--
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|unassigned at gcc dot gnu |pcarlini at suse dot de
|dot org |
Status|NEW |ASSIGNED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17038
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug libstdc++/17038] ABI impacting issue in time_put
2004-08-15 19:16 [Bug libstdc++/17038] New: ABI impacting issue in time_put pcarlini at suse dot de
` (7 preceding siblings ...)
2004-12-02 9:29 ` pcarlini at suse dot de
@ 2004-12-08 23:31 ` pcarlini at suse dot de
8 siblings, 0 replies; 12+ messages in thread
From: pcarlini at suse dot de @ 2004-12-08 23:31 UTC (permalink / raw)
To: gcc-bugs
--
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|--- |4.1.0
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/>]
* [Bug libstdc++/17038] ABI impacting issue in time_put
[not found] <bug-17038-16141@http.gcc.gnu.org/bugzilla/>
@ 2010-01-06 11:57 ` paolo dot carlini at oracle dot com
0 siblings, 0 replies; 12+ messages in thread
From: paolo dot carlini at oracle dot com @ 2010-01-06 11:57 UTC (permalink / raw)
To: gcc-bugs
------- Comment #6 from paolo dot carlini at oracle dot com 2010-01-06 11:57 -------
Now the buffer is 128 chars.
On second thought, I don't think checking the return value of strftime and all
the added complexity are worth the trouble: given the semantics of the function
and the actual data in existing named locales the maximum size is bounded and
certainly <~ 200. Also note that there are no risks of memory corruption. If
somebody reports a truncated output for some exotic locale, we'll increase the
buffer a bit and everything will be fine.
--
paolo dot carlini at oracle dot com changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |WORKSFORME
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17038
^ permalink raw reply [flat|nested] 12+ messages in thread
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).