cancel
Showing results for 
Search instead for 
Did you mean: 

Compiling problem with Cosmic CxSTM8 16K and LONG data

mjobard2
Associate
Posted on December 21, 2010 at 16:05

Compiling problem with Cosmic CxSTM8 16K and LONG data

4 REPLIES 4
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'...

mjobard2
Associate
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.

luca239955_stm1_st
Senior II
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

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?