为什么夹板不解析curl/curlbuild.h?
我编写了一个使用curl库的fornol.c
程序,因此包含以下内容:
#include <curl/curl.h>
我想在我的程序上运行splint
,但这是我得到的错误:
$ 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.
curlbuild.h
中的可疑行如下所示:
/* Data type definition of curl_socklen_t. */
typedef CURL_TYPEOF_CURL_SOCKLEN_T curl_socklen_t;
其中 CURL_TYPEOF_CURL_SOCKLEN_T
has was #define
d to be socklen_t
。
我在这里做错了什么吗?我应该向 splint 传递哪些标志才能使其在我的程序上运行?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我想我找到了解决方案。结果发现
sys/socket.h
不在我的机器上的/usr/include
下(我最近升级到 Ubuntu 11.10)。我必须将以下标志添加到
splint
:然后它就起作用了。
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.