I want to use SPLINT on my C-code for a 8bit Microcontroller. 
My code looks like this:
{
unsigned char tmp = 2;
unsigned char tmp2 = 0x30 + tmp;
}

I get the SPLINT results:
Variable tmp initialized to type int, expects unsigned char: 2
  To make char and int types equivalent, use +charint.
Incompatible types for + (int, unsigned char): 0x30 + tmp

Now my question:
SPLINT seems to interpret "2" and "0x30" as an integer (2-Byte) constant. In 
8bit systems those numbers are usually interpreted as 1-Byte values. 

I tried "+relaxquals" and get
Variable tmp initialized to type int, expects unsigned char: 2
Incompatible types for + (int, unsigned char): 0x30 + tmp

In addition I tried "+charint" and get
Variable tmp2 initialized to type int, expects unsigned char: 0x30 + tmp


How can I set SPLINT to take all values 0...255 as 1-Byte-values?


Kind regards
Ralf
_______________________________________________
splint-discuss mailing list
splint-discuss@mail.cs.virginia.edu
http://www.cs.virginia.edu/mailman/listinfo/splint-discuss

Reply via email to