Skip to main content
Visitor II
December 21, 2010
Question

Compiling problem with Cosmic CxSTM8 16K and LONG data

  • December 21, 2010
  • 4 replies
  • 942 views
Posted on December 21, 2010 at 16:05

Compiling problem with Cosmic CxSTM8 16K and LONG data

    This topic has been closed for replies.

    4 replies

    Super User
    May 17, 2011
    Posted on May 17, 2011 at 15:11

    The compiler is behaving perfectly correctly!

    ISO/IEC 9899:1990 - the so-called ''ANSI C'' specification - states:

    ''The type of an integer constant is the first of the corresponding list in which its value can be represented. Unsuffixed decimal: int, long int, unsigned long int...''

     

    If you want to force the type of the constant to be unsigned, then you need to add the suffix 'u' or 'U'...

    mjobard2Author
    Visitor II
    May 17, 2011
    Posted on May 17, 2011 at 15:11

    Works fine now... thanks for the reminder (but where is my Bible-C?!).

    'Thought that the compiler would warn that signed data was compared with unsigned variables, but I guess you can not expect too much from a free compiler.

    Visitor II
    May 17, 2011
    Posted on May 17, 2011 at 15:11

    >> 'Thought that the compiler would warn that signed data was compared with unsigned variables, but I guess you can not expect too much from a free compiler.

    can you provide an example of a compiler raising a warning for this?

    Regards,

    Luca

    Super User
    May 17, 2011
    Posted on May 17, 2011 at 15:11

    ''Thought that the compiler would warn that signed data was compared with unsigned variables''

    Other than special cases, what's to warn about?

    What warning would you suggest?