Bug 196323 - g++ gives line number out of range with -pedantic
g++ gives line number out of range with -pedantic
Status: CLOSED NOTABUG
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: gcc3 (Show other bugs)
4.0
i686 Linux
medium Severity medium
: ---
: ---
Assigned To: Jakub Jelinek
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2006-06-22 11:41 EDT by Mark Nodine
Modified: 2007-11-30 17:07 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2006-06-22 12:00:46 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Mark Nodine 2006-06-22 11:41:42 EDT
Description of problem:


Version-Release number of selected component (if applicable):
g++ (GCC) 3.2.3 20030502 (Red Hat Linux 3.2.3-52)

How reproducible:
Completely.

Steps to Reproduce:
1.  Create a file bug.cpp with the following text:
#line 32768 "test.c"
#line 32767 "test.c"
2. g++ -o -pedantic -Werror test.cpp

Actual results:
bug.cpp:1:7: line number out of range
(plus no .o file is generated due to -Werror)

Expected results:
No error message and generate .o

Additional info:
Apparently g++ requires numbers in line directives to fit in a signed
16-bit number, since 32767 is OK but 32768 is not.
Comment 1 Mark Nodine 2006-06-22 11:43:04 EDT
Sorry.  Step 2 should have been

2. g++ -o -pedantic -Werror bug.cpp
Comment 2 Jakub Jelinek 2006-06-22 12:00:46 EDT
Please read the standard:
ISO/IEC 14882:1998
In [cpp.line]/3:
"If the digit sequence specifies zero or a number greater than 32767,
the behavior is undefined."

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