Question

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 #defined to be socklen_t.

Am I doing something wrong here? What flags should I pass to splint to make it work on my program?

Was it helpful?

Solution

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:

-I/usr/include/x86_64-linux-gnu

And then it worked.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top