<< Back to previous view

[PCC-357] fails to check invalid redeclaration (like #162) Created: 15/Jun/11  Updated: 30/Jul/12

Status: Resolved
Project: pcc
Component/s: C frontend
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Trivial
Reporter: TAKAHASHI Tamotsu Assignee: Anders Magnusson
Resolution: Fixed Votes: 0

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

Comment by Anders Magnusson [ 06/Jul/11 07:04 PM ]
I'll rewrite some parts of declaration of automatic variables soon, it will be fixed then.
Comment by Anders Magnusson [ 30/Jul/12 06:55 PM ]
This bug is fixed, thanks.
Generated at Wed Apr 25 10:56:56 CEST 2018 using JIRA Enterprise Edition, Version: 3.13.1-#333.