Issue Details (XML | Word | Printable)

Key: PCC-70
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Anders Magnusson
Reporter: Jonathan Gray
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
pcc

cpp incorrectly parses code

Created: 08/Aug/09 11:17 AM   Updated: 09/Aug/09 02:03 PM
Component/s: C preprocessor
Affects Version/s: None
Fix Version/s: None

File Attachments: 1. File g.c (1 kB)

Environment: OpenBSD/i386 -current, pcc cvs


 Description  « Hide
When using directives that define function pointers and then creating an array of function pointers
pcc spuriously complains about redeclaration of flags. This has only started happening since the cpp overhaul.

$ pcc -c -Wall g.c -o g
g.c, line 41: redeclaration of flags
g.c, line 42: redeclaration of c

$ gcc -c -Wall g.c -o g
$

Test case attached.

 All   Comments   Change History      Sort Order: Ascending order - Click to sort in descending order
Anders Magnusson added a comment - 08/Aug/09 12:48 PM
Hm, this seems like another bug is exposed, that has to do with hiding of variables in casts.

Anders Magnusson added a comment - 09/Aug/09 02:03 PM
Block levels were not used in casts, so the existence of function arguments with names became global. Now fixed.