From: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
To: mackyle@gmail.com
Cc: Junio C Hamano <gitster@pobox.com>,
GIT Mailing-list <git@vger.kernel.org>
Subject: [PATCH] test-url-normalize.c: Fix gcc errors and sparse warnings
Date: Wed, 24 Jul 2013 20:07:55 +0100 [thread overview]
Message-ID: <51F0260B.5000905@ramsay1.demon.co.uk> (raw)
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 function)
test-url-normalize.c:49: error: (Each undeclared identifier is reported only once
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 <ramsay@ramsay1.demon.co.uk>
---
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.
Thanks!
ATB,
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);
+#ifdef USE_CURL_MULTI
else if (!strcmp("maxrequests", opt_lc.buf))
printf("%d\n", max_requests);
+#endif
else if (!strcmp("lowspeedlimit", opt_lc.buf))
printf("%ld\n", curl_low_speed_limit);
else if (!strcmp("lowspeedtime", opt_lc.buf))
--
1.8.3
next reply other threads:[~2013-07-24 19:10 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-24 19:07 Ramsay Jones [this message]
2013-07-24 19:35 ` [PATCH] test-url-normalize.c: Fix gcc errors and sparse warnings Kyle J. McKay
2013-07-24 20:39 ` Junio C Hamano
2013-07-29 22:49 ` [PATCH 0/3] "git config --get-urlmatch $section.$key $url" Junio C Hamano
2013-07-29 22:49 ` [PATCH 1/3] url-match: split out URL matching logic out of http.c Junio C Hamano
2013-07-29 22:49 ` [PATCH 2/3] builtin/config: refactor collect_config() Junio C Hamano
2013-07-29 22:49 ` [PATCH 3/3] config: --get-urlmatch Junio C Hamano
2013-07-30 0:37 ` Jeff King
2013-07-30 1:33 ` Junio C Hamano
2013-07-30 8:14 ` Jeff King
2013-07-30 13:52 ` Junio C Hamano
2013-07-30 19:14 ` Kyle J. McKay
2013-07-30 2:03 ` [PATCH 4/3] url-match: generalize configuration collection logic Junio C Hamano
2013-07-30 2:13 ` [PATCH 5/3] revert most of the http_options() change Junio C Hamano
2013-07-30 19:14 ` Kyle J. McKay
2013-07-30 19:41 ` Kyle J. McKay
2013-07-30 21:09 ` Junio C Hamano
2013-07-31 17:59 ` [PATCH 0/3] "git config --get-urlmatch $section.$key $url" Ramsay Jones
2013-07-31 19:31 ` Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=51F0260B.5000905@ramsay1.demon.co.uk \
--to=ramsay@ramsay1.demon.co.uk \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=mackyle@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).