public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: libstdc++/7920: std::numeric_limits<char>::digits10 is incorrect (7, not 3)
@ 2002-10-11 13:21 gdr
  0 siblings, 0 replies; 3+ messages in thread
From: gdr @ 2002-10-11 13:21 UTC (permalink / raw)
  To: gcc-bugs, gcc-prs, gdr, nobody, sbeasley

Synopsis: std::numeric_limits<char>::digits10 is incorrect (7, not 3)

Responsible-Changed-From-To: unassigned->gdr
Responsible-Changed-By: gdr
Responsible-Changed-When: Fri Oct 11 13:21:30 2002
Responsible-Changed-Why:
    .
State-Changed-From-To: analyzed->closed
State-Changed-By: gdr
State-Changed-When: Fri Oct 11 13:21:30 2002
State-Changed-Why:
    Fixed on branch as well.

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=7920


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: libstdc++/7920: std::numeric_limits<char>::digits10 is incorrect (7, not 3)
@ 2002-09-29  0:44 paolo
  0 siblings, 0 replies; 3+ messages in thread
From: paolo @ 2002-09-29  0:44 UTC (permalink / raw)
  To: gcc-bugs, gcc-prs, nobody, sbeasley

Synopsis: std::numeric_limits<char>::digits10 is incorrect (7, not 3)

State-Changed-From-To: open->analyzed
State-Changed-By: paolo
State-Changed-When: Sun Sep 29 00:44:39 2002
State-Changed-Why:
    This is already fixed for 3.3. Confirmed, but not a
    regression, for 3.2. The correct value, however, is 2 not
    3, since - according to 18.2.1.2,9 - digits10 is "number of
    base10 digits that can be represented without change" and
    definitely for char on your system this is impossible for,
    say, 500!

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=7920


^ permalink raw reply	[flat|nested] 3+ messages in thread

* libstdc++/7920: std::numeric_limits<char>::digits10 is incorrect (7, not 3)
@ 2002-09-14 20:46 sbeasley
  0 siblings, 0 replies; 3+ messages in thread
From: sbeasley @ 2002-09-14 20:46 UTC (permalink / raw)
  To: gcc-gnats


>Number:         7920
>Category:       libstdc++
>Synopsis:       std::numeric_limits<char>::digits10 is incorrect (7, not 3)
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Sep 14 20:46:08 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     sbeasley@cs.uic.edu
>Release:        gcc version 3.1.1 20020703 (Debian prerelease)
>Organization:
>Environment:
Linux x86 2.4.17
>Description:
std::numeric_limits<char>::digits10 on this system reports 7, not 3 as expected. The source indicates that the macros used to obtain this value inadvertently use the value of std::numeric_limits<char>::digits, which is 7.
>How-To-Repeat:
std::cout << std::numeric_limits<char>::digits10;
>Fix:
Two macros in libstdc++/include/std/std_limits.h must be changed to use digits10 instead of digits. Attached is a diff -Naur of the file. Of particular interest:

-#  define __glibcpp_char_digits10 __glibcpp_signed_char_digits
+#  define __glibcpp_char_digits10 __glibcpp_signed_char_digits10

-#  define __glibcpp_char_digits10 __glibcpp_unsigned_char_digits
+#  define __glibcpp_char_digits10 __glibcpp_unsigned_char_digits10
>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: text/plain; name="patch.txt"
Content-Disposition: inline; filename="patch.txt"

--- std_limits.h        2002-09-14 22:12:08.000000000 -0500
+++ std_limits_fixed.h  2002-09-14 22:12:55.000000000 -0500
@@ -364,12 +364,12 @@
 #  define __glibcpp_char_min (char)__glibcpp_signed_char_min
 #  define __glibcpp_char_max (char)__glibcpp_signed_char_max
 #  define __glibcpp_char_digits __glibcpp_signed_char_digits
-#  define __glibcpp_char_digits10 __glibcpp_signed_char_digits
+#  define __glibcpp_char_digits10 __glibcpp_signed_char_digits10
 #else
 #  define __glibcpp_char_min (char)__glibcpp_unsigned_char_min
 #  define __glibcpp_char_max (char)__glibcpp_unsigned_char_max
 #  define __glibcpp_char_digits __glibcpp_unsigned_char_digits
-#  define __glibcpp_char_digits10 __glibcpp_unsigned_char_digits
+#  define __glibcpp_char_digits10 __glibcpp_unsigned_char_digits10
 #endif

 // short


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2002-10-11 20:21 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-10-11 13:21 libstdc++/7920: std::numeric_limits<char>::digits10 is incorrect (7, not 3) gdr
  -- strict thread matches above, loose matches on Subject: below --
2002-09-29  0:44 paolo
2002-09-14 20:46 sbeasley

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).