Open claucece opened 6 years ago
So, I've just pushed a few comments that makes it possible to run splint in a correct way on ALL our files (except for test files). This gives over 3000 warnings. In order to see them, open the .splintrc file, take away one of the suppressions, and start fixing!
make splint
is how to run splint. (obviously you have to have splint installed)
Funny enough, it generates no warnings for me.
Yeah, because I added all the suppressions. As is, it doesn't warn for me either - you have to remove the suppressions in .splintrc
like I say in the comment above.
So, yeah @olabini I still get a lot of parsing errors. And I get prepoc errors:
src/ed448.h:24:24: Cannot find include file goldilocks.h on search path:
/usr/include;/usr/local/Cellar/splint/3.1.2/include
Preprocessing error. (Use -preproc to inhibit warning)
In file included from src/auth.h:26,
from src/auth.c:23
src/ed448.h:25:30: Cannot find include file goldilocks/ed448.h on search path:
/usr/include;/usr/local/Cellar/splint/3.1.2/include
src/keys.h:24:24: Cannot find include file goldilocks.h on search path:
/usr/include;/usr/local/Cellar/splint/3.1.2/include
In file included from src/auth.h:27,
from src/auth.c:23
src/keys.h:25:30: Cannot find include file goldilocks/ed448.h on search path:
/usr/include;/usr/local/Cellar/splint/3.1.2/include
src/shake.h:24:30: Cannot find include file goldilocks/shake.h on search path:
/Users/sofia/repos/otrv4/libotr-ng/src;/usr/include;/usr/local/Cellar/splint
/3.1.2/include
In file included from src/auth.c:26
When I add the flag -preproc, it runs. But still gets into parsing errors. This may be another 'cannot fix for MAC'.
So, I sort of scroll on the warnings printed, and this one repeats a lot:
Function parameter a declared as manifest array
.. should we fix this?
It is related to:
http://c-faq.com/aryptr/aryptrparam.html https://stackoverflow.com/questions/3655566/what-is-the-meaning-of-this-splint-warning-and-what-might-i-be-doing-wrong
We decided around the 'manifest arrays' to change them to arrays everywhere and then define in the documentation of which size.
So, most of the above comments are not relevant anymore. In order to work on splint issues, look in .splintrc, comment one of the suppressions and try to fix the issue. For reference, the current temporary suppressions are:
+boolint
+voidabstract
+matchanyintegral
-branchstate
-compdef
-compdestroy
-compmempass
-exportlocal
-fixedformalarray
-globstate
-incondefs
-mayaliasunique
-mustfreefresh
-mustfreeonly
-noeffect
-nullassign
-nullpass
-nullret
-nullstate
-statictrans
-temptrans
-type
-unqualifiedtrans
-unrecog
-usedef
-usereleased
Why
A library should use a static analyzer.
Issues reported:
in list.c
in tlv.c