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
Operations

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

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.

gcc:
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 made changes - 06/Jul/11 07:03 PM
Field Original Value New Value
Assignee Anders Magnusson [ ragge ]
Anders Magnusson made changes - 30/Jul/12 06:55 PM
Status Open [ 1 ] Resolved [ 5 ]
Resolution Fixed [ 1 ]