Sparse issues an "non-ANSI function declaration of function 'main'"
warning when NO_CURL is set. In order to suppress the warning, we
simply add the function prototype.

When NO_CURL and USE_CURL_MULTI are not defined, then gcc issues the
following error:

      CC test-url-normalize.o
  test-url-normalize.c: In function `run_http_options':
  test-url-normalize.c:49: error: `max_requests' undeclared (first use in this 
  test-url-normalize.c:49: error: (Each undeclared identifier is reported only 
  test-url-normalize.c:49: error: for each function it appears in.)
  make: *** [test-url-normalize.o] Error 1

In order to fix the error, we simply protect the use of the 'max_requests'
variable with an preprocessor conditional.

Signed-off-by: Ramsay Jones <>

Hi Kyle,

When you next update the patches in your 'km/http-curl-config-per-url'
branch, could you please squash this (or something like it) into the
relevant patches.


Ramsay Jones

 test-url-normalize.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/test-url-normalize.c b/test-url-normalize.c
index abfa4eb..86ce553 100644
--- a/test-url-normalize.c
+++ b/test-url-normalize.c
@@ -1,6 +1,6 @@
 #ifdef NO_CURL
-int main()
+int main(void)
        return 125;
@@ -45,8 +45,10 @@ static int run_http_options(const char *file,
                printf("%s\n", curl_ssl_try ? "true" : "false");
        else if (!strcmp("minsessions", opt_lc.buf))
                printf("%d\n", min_curl_sessions);
        else if (!strcmp("maxrequests", opt_lc.buf))
                printf("%d\n", max_requests);
        else if (!strcmp("lowspeedlimit", opt_lc.buf))
                printf("%ld\n", curl_low_speed_limit);
        else if (!strcmp("lowspeedtime", opt_lc.buf))

To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to
More majordomo info at

Reply via email to