From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25857 invoked by alias); 15 Sep 2002 03:46:10 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 25815 invoked by uid 71); 15 Sep 2002 03:46:09 -0000 Resent-Date: 15 Sep 2002 03:46:09 -0000 Resent-Message-ID: <20020915034609.25814.qmail@sources.redhat.com> Resent-From: gcc-gnats@gcc.gnu.org (GNATS Filer) Resent-Cc: gcc-prs@gcc.gnu.org, gcc-bugs@gcc.gnu.org Resent-Reply-To: gcc-gnats@gcc.gnu.org, sbeasley@cs.uic.edu Received: (qmail 22920 invoked by uid 61); 15 Sep 2002 03:38:02 -0000 Message-Id: <20020915033802.22919.qmail@sources.redhat.com> Date: Sat, 14 Sep 2002 20:46:00 -0000 From: sbeasley@cs.uic.edu Reply-To: sbeasley@cs.uic.edu To: gcc-gnats@gcc.gnu.org X-Send-Pr-Version: gnatsweb-2.9.3 (1.1.1.1.2.31) Subject: libstdc++/7920: std::numeric_limits::digits10 is incorrect (7, not 3) X-SW-Source: 2002-09/txt/msg00377.txt.bz2 List-Id: >Number: 7920 >Category: libstdc++ >Synopsis: std::numeric_limits::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::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::digits, which is 7. >How-To-Repeat: std::cout << std::numeric_limits::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