[splint-discuss] (How) does the 'unsignedintegraltype' annotation
work?
Ludolf Holzheid
lholzheid at bihl-wiedemann.de
Thu Jun 29 09:59:45 EDT 2006
Hello,
the 'unsignedintegraltype' annotation does not work as I expect:
Splint warns if an unsigned integer constant is assigned to a
variable of an 'unsignedintegraltype' annotated type, and it does not
warn if a negative integer constant is assigned to such a variable.
Attached is a code snippet.
Is this behavior intended or am I missing something?
Ludolf
--
---------------------------------------------------------------
Ludolf Holzheid Tel: +49 621 339960
Bihl+Wiedemann GmbH Fax: +49 621 3392239
Floßwörthstraße 41 e-mail: lholzheid at bihl-wiedemann.de
D-68199 Mannheim, Germany
---------------------------------------------------------------
-------------- next part --------------
typedef /*@unsignedintegraltype@*/ uint8_t;
static uint8_t u8a;
/*@-paramuse@*/
int main (int argc, char *argv [])
{
// splint expected
//
u8a = 1; // no warning warning?
u8a = 1u; // warning no warning <---
u8a = 1l; // warning warning
u8a = 1lu; // warning warning?
u8a = -1; // no warning warning <---
return (0);
}
More information about the splint-discuss
mailing list