Menu

#3495 "error 0: Duplicate symbol" for no obvious reason

open
nobody
None
other
5
2022-09-24
2022-09-24
No

This function compiles without problems:

void dummy123(void)                                                             
{                                                                               
    { enum { BLA = 2 }; };                                                      
    { enum { BLA = 2 }; };                                                      
}            

Adding a variable declaration between the two enums results in a compiler error because of a duplicate symbol:

void dummy123(void)                                                             
{                                                                               
    { enum { BLA = 2 }; };                                                      
    volatile int a = 3;                                                         
    { enum { BLA = 2 }; };                                                      
}                                                                               

The error message is

xyz.c:271: error 0: Duplicate symbol 'BLA', symbol IGNORED

I tested this with the current svn trunk and with sdcc 4.2 on stm8.

Discussion


Log in to post a comment.

MongoDB Logo MongoDB