[splint-discuss] Problem in using WIFSIGNALED(status)

Ludolf Holzheid lholzheid at bihl-wiedemann.de
Fri Mar 28 10:53:31 PST 2008


On Fri, 2008-03-28 10:04:46 +0530, Vishal Bayskar wrote:
> [..]
> 
>             And the following warnings are being shown by splint 
> 
> bt_agent.c:1877:11: Left operand of >> may be negative (char):
>                                    (char)((((*(int *)&(ret))) & 0x7f) +1) >> 1
>   The left operand to a shift operator may be negative (behavior is
>   implementation-defined). (Use -shiftimplementation to inhibit warning)
> lbt_agent.c:1877:10: Operands of > have incompatible types (char, int):
>                                    ((char)((((*(int *)&(ret))) & 0x7f) +1) >> 1) > 0
>   Types are incompatible. (Use -type to inhibit warning)
> 
> [..]
> 
> Is this a bug of defining __WIFSIGNALED?

Vishal,

The definition of WIFSIGNALED is not buggy as it is part of a system
header, and the system designers know what the (system) compiler does
in areas marked as 'implementation-defined' by the C standard.

You should exclude the system headers from checking by splint (see the
-skip-posix-headers flag). You might also use the POSIX standard
library in order to have a declaration for WIFSIGNALED (see the
-posix-lib flag).

HTH,

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
---------------------------------------------------------------



More information about the splint-discuss mailing list