[splint-discuss] Unrecognized macros like "timerisset" "timercmp"

Tommy Pettersson ptp at lysator.liu.se
Fri Aug 18 07:28:16 EDT 2006


On Fri, Aug 18, 2006 at 05:32:04PM +0800, raymond wrote:
> 	splint +posixlib -skip-posix-headers test2.c
[...]
>         test2.c:13:6: Unrecognized identifier: timerisset
[...]
> It seems splint can not recognize the macro in <sys/time.h> like
> "timerisset" & "timercmp"

Splint does not use sys/time.h. It uses internal libraries
guaranteed to be compliant with the standard checked for.
timerisset and timercmp are BSD extensions, not posix or ansi,
so splint does right in not recognizing them in posix mode.

There's a unixlib in splint, but it does not declare timerisset
or timercmp. I don't know if it should. A portable solution
would do something like checking if these macros are defined or
else define them. Then your code really will compile in a posix
environment. If you only want to make splint happy for the time
being, you can define the macros just for splint within #ifdef
S_SPLINT_S / #endif.


-- 
Tommy Pettersson <ptp at lysator.liu.se>


More information about the splint-discuss mailing list