#279 Preprocessor is Silent for Macro Redef

closed-fixed
5
2013-05-25
2002-01-14
No

Hi,
The SDCC preprocessor allows the redefinition of macros. This is an error in ISO C. Compilers
like gcc and VC++ generate warnings in this case.

For example in gcc,

#define MYDEF 1
#define MYDEF 2
#define MACRO(x) x+1
#define MACRO(x) x+2

would generate,

test7.c:94: warning: `MYDEF' redefined
test7.c:93: warning: this is the location of the previous definition
test7.c:96: warning: `MACRO' redefined
test7.c:95: warning: this is the location of the previous definition

Geoffrey

Discussion

  • Johan Knol

    Johan Knol - 2002-01-15
    • milestone: --> fixed
    • assigned_to: nobody --> johanknol
    • status: open --> closed-fixed
     
  • Johan Knol

    Johan Knol - 2002-01-15

    Logged In: YES
    user_id=63512

    fixed in support/cpp2/cppmacro.c:1.2

     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks