Issue Details (XML | Word | Printable)

Key: PCC-357
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Trivial Trivial
Assignee: Anders Magnusson
Reporter: TAKAHASHI Tamotsu
Votes: 0
Watchers: 0

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

fails to check invalid redeclaration (like #162)

Created: 15/Jun/11 08:06 AM   Updated: 30/Jul/12 06:55 PM
Component/s: C frontend
Affects Version/s: None
Fix Version/s: None

 Description  « Hide
PCC doesn't complain building this code:

   #include <stdio.h>
   int f(int a)
     printf("%d\n", a);
     char a; /* BUG */
     printf("%d\n", a);
     return a;
   int main (){
     return f(60000);

Of course, the second printf outputs random numbers.

test.c: In function 'f':
test.c:5: error: 'a' redeclared as different kind of symbol
test.c:2: error: previous definition of 'a' was here

 All   Comments   Change History      Sort Order: Ascending order - Click to sort in descending order
Anders Magnusson added a comment - 06/Jul/11 07:04 PM
I'll rewrite some parts of declaration of automatic variables soon, it will be fixed then.

Anders Magnusson added a comment - 30/Jul/12 06:55 PM
This bug is fixed, thanks.