How to include version information into the code?

Gál Zsolt
2013-04-19
2013-04-19
  • Gál Zsolt
    Gál Zsolt
    2013-04-19

    Hello,

    I had an idea about my program display version information on a 2x16 point LCD. LCD_puts( ) is a function to send caracters of the given string to the LCD. I tried to do it by this way:

    LCD_puts( __SDCC );
    

    It gives error at compiling.

    LCD_puts( "__SDCC" );
    

    This stores characters between double quotes, not the version number.

    #define str( x ) #x
    LCD_puts( str( __SDCC ) );
    

    The result is equal what was at the previous.

    Finally I tried to put version information as a comment in the assembly code:

    __asm ; __SDCC __endasm
    

    and I get what I expected:
    ; 3_2_1

    So __SDCC constant has the information about the version number of the compiler but I don't know how can I include it into the running code.

    Can anybody help me about it?

    sdcc -v
    SDCC : pic14 3.2.1 #8447 (Apr 18 2013) (Linux)
    
     
  • Gál Zsolt
    Gál Zsolt
    2013-04-19

    Thanks! That is what I was thinking about.