diff options
author | Ramsay Jones <ramsay@ramsay1.demon.co.uk> | 2013-10-06 21:52:21 +0100 |
---|---|---|
committer | Jonathan Nieder <jrnieder@gmail.com> | 2013-10-14 16:22:28 -0700 |
commit | 9371322a60932ca91ed8e27f88eb7af92df29716 (patch) | |
tree | 143eeb124fb32bd469826736fffd99f4ef3e5e64 /test-read-cache.c | |
parent | format-patch doc: Thunderbird wraps lines unless mailnews.wraplength=0 (diff) | |
download | tgif-9371322a60932ca91ed8e27f88eb7af92df29716.tar.xz |
sparse: suppress some "using sizeof on a function" warnings
Sparse issues an "using sizeof on a function" warning for each
call to curl_easy_setopt() which sets an option that takes a
function pointer parameter. (currently 12 such warnings over 4
files.)
The warnings relate to the use of the "typecheck-gcc.h" header
file which adds a layer of type-checking macros to the curl
function invocations (for gcc >= 4.3 and !__cplusplus). As part
of the type-checking layer, 'sizeof' is applied to the function
parameter of curl_easy_setopt(). Note that, in the context of
sizeof, the function to function pointer conversion is not
performed and that sizeof(f) != sizeof(&f).
A simple solution, therefore, would be to replace the function
name in each such call to curl_easy_setopt() with an explicit
function pointer expression (i.e. replace f with &f).
However, the "typecheck-gcc.h" header file is only conditionally
included, in addition to the gcc and C++ checks mentioned above,
depending on the CURL_DISABLE_TYPECHECK preprocessor variable.
In order to suppress the warnings, we use target-specific variable
assignments to add -DCURL_DISABLE_TYPECHECK to SPARSE_FLAGS for
each file affected (http-push.c, http.c, http-walker.c and
remote-curl.c).
Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Diffstat (limited to 'test-read-cache.c')
0 files changed, 0 insertions, 0 deletions