Bug 92007 - cpp confused by the attached C source
Summary: cpp confused by the attached C source
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: gcc (Show other bugs)
(Show other bugs)
Version: 9
Hardware: i386 Linux
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact: Brian Brock
Depends On:
TreeView+ depends on / blocked
Reported: 2003-05-31 01:17 UTC by Szombathelyi György
Modified: 2007-04-18 16:54 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2003-05-31 08:10:56 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
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-31 01:19 UTC, Szombathelyi György
no flags Details

Description Szombathelyi György 2003-05-31 01:17:17 UTC
Description of problem: 
cpp confused by the attached C source 
Version-Release number of selected component (if applicable): 
How reproducible: 
Try to compile the attached source file 
Steps to Reproduce: 
1. Compile the source file 
2. See the error message 
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-31 01:19:01 UTC
Created attachment 92064 [details]
Source files triggers the bug

Comment 2 Jakub Jelinek 2003-05-31 08:10:56 UTC
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 08:26:22 UTC
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.