Bug 92007 - cpp confused by the attached C source
cpp confused by the attached C source
Status: CLOSED NOTABUG
Product: Red Hat Linux
Classification: Retired
Component: gcc (Show other bugs)
9
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Jakub Jelinek
Brian Brock
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2003-05-30 21:17 EDT by Szombathelyi György
Modified: 2007-04-18 12:54 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2003-05-31 04:10:56 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)
Source files triggers the bug (176 bytes, text/plain)
2003-05-30 21:19 EDT, Szombathelyi György
no flags Details

  None (edit)
Description Szombathelyi György 2003-05-30 21:17:17 EDT
Description of problem: 
cpp confused by the attached C source 
 
Version-Release number of selected component (if applicable): 
3.2.2-5 
 
How reproducible: 
Try to compile the attached source file 
 
Steps to Reproduce: 
1. Compile the source file 
2. See the error message 
3. 
     
Actual results: 
The compile fails with  
test.c:6: warning: no semicolon at end of struct or union 
test.c:6: parse error before '.' token 
test.c:7: warning: data definition has no type or storage class 
test.c: In function `main': 
test.c:11: parse error before "t" 
test.c:13: `t' undeclared (first use in this function) 
test.c:13: (Each undeclared identifier is reported only once 
test.c:13: for each function it appears in.) 
 
Expected results: 
The file compiles successfully 
 
Additional info: 
 
The problem appears only when I include <sys/stat.h> 
The preprocessor seems to be confused (a fragment of the preprocessor output): 
 
. 
. 
. 
# 3 "test.c" 2 
 
typedef struct __rr_entry { 
        time_t t_creat; 
        time_t st_mtim.tv_sec; 
} rr_entry; 
 
int main() { 
. 
. 
.
Comment 1 Szombathelyi György 2003-05-30 21:19:01 EDT
Created attachment 92064 [details]
Source files triggers the bug
Comment 2 Jakub Jelinek 2003-05-31 04:10:56 EDT
The testcase is ill-formed. If you include <sys/stat.h>, all identifiers starting
with st_, S_ or ending with _t are reserved for implementation, ie. you cannot
assume they are not macros, don't clash with some function or variable.
Comment 3 Jakub Jelinek 2003-05-31 04:26:22 EDT
FYI, to be exact, e.g. IEEE 1003.1, 2003 Edition, 2.2.2 specifies this.

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