{"thread":{"id":"10912","subject":"[PATCH] avoid \"defined but not used\" warning for fetch_objs_via_walker","startedAt":"2007-11-18T08:17:23Z","lastAt":"2007-11-21T18:05:01Z","messageCount":3,"participants":["Jeff King","Junio C Hamano","Daniel Barkalow"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"60211","messageId":"20071118081722.GA31563@sigill.intra.peff.net","threadId":"10912","inReplyTo":null,"subject":"[PATCH] avoid \"defined but not used\" warning for fetch_objs_via_walker","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2007-11-18T08:17:23Z","receivedAt":"2007-11-18T08:17:23Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"Because this function is static and used only by the\nhttp-walker, when NO_CURL is defined, gcc emits a \"defined\nbut not used\" warning.\n\nSigned-off-by: Jeff King <peff@peff.net>\n---\nOn master. I like to compile with -Werror to make sure I don't miss\nwarnings as the compile scrolls by.\n\nThis fix feels a little wrong, since the function isn't specific to http\nsupport, but hopefully the comment should be obvious if we ever add\nanother similar commit walker that needs it.\n\n transport.c |    2 ++\n 1 files changed, 2 insertions(+), 0 deletions(-)\n\ndiff --git a/transport.c b/transport.c\nindex e8a2608..43b9e7c 100644\n--- a/transport.c\n+++ b/transport.c\n@@ -344,6 +344,7 @@ static int rsync_transport_push(struct transport *transport,\n \n /* Generic functions for using commit walkers */\n \n+#ifndef NO_CURL /* http fetch is the only user */\n static int fetch_objs_via_walker(struct transport *transport,\n \t\t\t\t int nr_objs, struct ref **to_fetch)\n {\n@@ -370,6 +371,7 @@ static int fetch_objs_via_walker(struct transport *transport,\n \tfree(dest);\n \treturn 0;\n }\n+#endif /* NO_CURL */\n \n static int disconnect_walker(struct transport *transport)\n {\n-- \n1.5.3.5.1817.gd2b4b-dirty\n"},{"id":"60469","messageId":"7v63zwhy4i.fsf@gitster.siamese.dyndns.org","threadId":"10912","inReplyTo":"20071118081722.GA31563@sigill.intra.peff.net","subject":"Re: [PATCH] avoid \"defined but not used\" warning for fetch_objs_via_walker","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2007-11-21T07:10:53Z","receivedAt":"2007-11-21T07:10:53Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jeff King <peff@peff.net> writes:\n\n> Because this function is static and used only by the\n> http-walker, when NO_CURL is defined, gcc emits a \"defined\n> but not used\" warning.\n>\n> Signed-off-by: Jeff King <peff@peff.net>\n> ---\n> On master. I like to compile with -Werror to make sure I don't miss\n> warnings as the compile scrolls by.\n>\n> This fix feels a little wrong, since the function isn't specific to http\n> support, but hopefully the comment should be obvious if we ever add\n> another similar commit walker that needs it.\n\nYeah, while I share your -Werror desire it sure feels a bit\ndirty.  As it does not look like we will be taking any new\nwalkers, I think your patch is reasonable, though.\n"},{"id":"60552","messageId":"Pine.LNX.4.64.0711211303460.32410@iabervon.org","threadId":"10912","inReplyTo":"7v63zwhy4i.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH] avoid \"defined but not used\" warning for fetch_objs_via_walker","fromName":"Daniel Barkalow","fromEmail":"barkalow@iabervon.org","sentAt":"2007-11-21T18:05:01Z","receivedAt":"2007-11-21T18:05:01Z","isPatch":true,"sender":{"key":"barkalow@iabervon.org","avatar":"https://avatars.githubusercontent.com/u/55364219?v=4"},"body":"On Tue, 20 Nov 2007, Junio C Hamano wrote:\n\n> Jeff King <peff@peff.net> writes:\n> \n> > Because this function is static and used only by the\n> > http-walker, when NO_CURL is defined, gcc emits a \"defined\n> > but not used\" warning.\n> >\n> > Signed-off-by: Jeff King <peff@peff.net>\n> > ---\n> > On master. I like to compile with -Werror to make sure I don't miss\n> > warnings as the compile scrolls by.\n> >\n> > This fix feels a little wrong, since the function isn't specific to http\n> > support, but hopefully the comment should be obvious if we ever add\n> > another similar commit walker that needs it.\n> \n> Yeah, while I share your -Werror desire it sure feels a bit\n> dirty.  As it does not look like we will be taking any new\n> walkers, I think your patch is reasonable, though.\n\nI think we're likely to do sftp someday, but everything is likely to get \nreorganized before that anyway.\n\n\t-Daniel\n*This .sig left intentionally blank*\n"}]}