This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Compier checks section under #ifdef UNDEFINED -> error

It seems a bug crept in CC ARM, may be not only ARM. Consider next code:

#ifdef IDENTIFIER
    IDENTIFIER();
#endif

and build output:

..\..\src\module\module.cpp(344): error:  #20: identifier "IDENTIFIER" is undefined


GCC does not have such problem. Check <a href=coliru.stacked-crooked.com/.../7e6350bd2bfbc14a >here</a>

Parents
  • In addition

    //#define LED  PA7
    #ifdef LED
        led_on(LED);  //if 1st string commented, we will get an error "undefined identifier"
    #endif
    

    I have found workaround

    #define LED  0 //PA7
    #if LED
        led_on(LED);
    #endif
    

    But I would like to have ability to undefine LED at all.

Reply
  • In addition

    //#define LED  PA7
    #ifdef LED
        led_on(LED);  //if 1st string commented, we will get an error "undefined identifier"
    #endif
    

    I have found workaround

    #define LED  0 //PA7
    #if LED
        led_on(LED);
    #endif
    

    But I would like to have ability to undefine LED at all.

Children