Just like any other constant that you use a lot, it's better to define a 
correct sized constant and to use that definition.  For example:

#define UCHAR_0 (unsigned char)0

As long as you're using that to initialize the correct type, it'll pass the 
Splint checks.

-Bryan

-----Original Message-----
From: splint-discuss-boun...@cs.virginia.edu 
[mailto:splint-discuss-boun...@cs.virginia.edu] On Behalf Of Frank Hrebabetzky
Sent: Friday, April 06, 2012 12:36 PM
To: splint-discuss@mail.cs.virginia.edu
Subject: [splint-discuss] <variable> = 1;

There are a lot of assignments of 1 and 0 to variables in my program.
The variables are usually unsigned or char, and splint complains
because the literals are int.

I don't want to disable type compatibility checks alltogether. Is it
possible to disable these checks just for literals, or to declare 0
and 1 as unsigned char?

Thanks
-- 
hreba
_______________________________________________
splint-discuss mailing list
splint-discuss@mail.cs.virginia.edu
http://www.cs.virginia.edu/mailman/listinfo/splint-discuss

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

Reply via email to