The command man timercmp lists the construct as valid, hence I believe this to be a false positive:
man timercmp
vely-master/fcli.c:494:42: error: syntax error: <) [syntaxError] if (timercmp (&elapsed, &(fc_l->tout), < )) { ^
To replicate:
wget https://github.com/velydev/vely/archive/refs/heads/master.zip unzip -q master.zip cppcheck -i v1.c --enable=all --output-file=vely.cppcheck vely-master/ grep -C2 "error:" vely.cppcheck
Not sure why the -i v1.c is necessary, perhaps it is an infinite recursion.
-i v1.c
Cppcheck 2.7 on Ubuntu 22.04.
You probably need to pass --library=gnu.
--library=gnu
Ok, thanks, that works. I did not see this in the manual.
The corresponding section in the manual is not all that helpful, see https://trac.cppcheck.net/ticket/12225
Log in to post a comment.
The command
man timercmp
lists the construct as valid, hence I believe this to be a false positive:To replicate:
Not sure why the
-i v1.c
is necessary, perhaps it is an infinite recursion.Cppcheck 2.7 on Ubuntu 22.04.
Last edit: figaro_ 2023-11-23
You probably need to pass
--library=gnu
.Ok, thanks, that works. I did not see this in the manual.
The corresponding section in the manual is not all that helpful, see https://trac.cppcheck.net/ticket/12225