I wrote a fornol.c
program that uses the curl library, and therefore includes the following:
#include <curl/curl.h>
I want to run splint
on my program, but this is the error I get:
$ splint fornol.c
Splint 3.1.2 --- 03 May 2009
/usr/include/curl/curlbuild.h:165:33: Parse Error:
Suspect missing struct or union keyword: socklen_t :
int. (For help on parse errors, see splint -help parseerrors.)
*** Cannot continue.
The suspect line in curlbuild.h
looks like this:
/* Data type definition of curl_socklen_t. */
typedef CURL_TYPEOF_CURL_SOCKLEN_T curl_socklen_t;
Where CURL_TYPEOF_CURL_SOCKLEN_T
has been #define
d to be socklen_t
.
Am I doing something wrong here? What flags should I pass to splint to make it work on my program?
I think I found the solution. Turns out that
sys/socket.h
is not under/usr/include
on my machine (which I recently upgraded to Ubuntu 11.10).I had to add the following flag to
splint
:And then it worked.