Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 157174 - g++4 does not work with system include file <limits> if -pedantic option is given
Summary: g++4 does not work with system include file <limits> if -pedantic option is g...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: gcc
Version: 3
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks: 164806
TreeView+ depends on / blocked
 
Reported: 2005-05-08 09:44 UTC by roebel
Modified: 2007-11-30 22:11 UTC (History)
1 user (show)

Fixed In Version: 3.4.4-1
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2005-09-05 08:44:39 UTC


Attachments (Terms of Use)

Description roebel 2005-05-08 09:44:01 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (compatible; Konqueror/3.3; Linux) (KHTML, like Gecko)

Description of problem:
g++4 -D_Pm2_VERSION_=\"0.9-beta3\" -D_Pm2_USER_=\"roebel\" -I. -I../LibSrc   
-O3 -funroll-loops -pthread   -Wall  -pedantic    -o ../obj_/Pm2Sdif.o -c 
Pm2Sdif.cpp 
/usr/include/c++/3.4.3/limits:996: error: floating-point literal cannot appear 
in a constant-expression 
/usr/include/c++/3.4.3/limits:1009: error: field initializer is not constant 
/usr/include/c++/3.4.3/limits:1052: error: floating-point literal cannot 
appearin a constant-expression 
/usr/include/c++/3.4.3/limits:1065: error: field initializer is not constant 
/usr/include/c++/3.4.3/limits:1108: error: floating-point literal cannot 
appearin a constant-expression 
/usr/include/c++/3.4.3/limits:1122: error: field initializer is not constant 
/u/formes/share/include/sdif.h:251: warning: â_sdif_h_cvs_revision_â defined 
but not used 
m 

Version-Release number of selected component (if applicable):
gcc4-c++-4.0.0-0.41.fc3


How reproducible:
Always

Steps to Reproduce:
1. compile a c++ file that includes <limits> and give -pedantic option 
2. 
3. 
   

Actual Results:  see above 

Expected Results:  gcc 3.4 did compile! 

Additional info:

Comment 1 Jakub Jelinek 2005-05-08 10:23:52 UTC
The error is correct.  libstdc++-v3 was fixed in GCC 4.0:
2005-01-31  Mark Mitchell  <mark@codesourcery.com>

        * include/std/std_limits.h (numeric_limits<float>::has_denorm):
        Add required cast.
        (numeric_limits<double>::has_denorm): Likewise.
        (numeric_limits<long double>::has_denorm): Likewise.


Comment 2 Jakub Jelinek 2005-05-27 15:22:43 UTC
Should be fixed in gcc-3.4.4-1.


Note You need to log in before you can comment on or make changes to this bug.