{"thread":{"id":"40995","subject":"compile error in Git v2.7.0-rc0","startedAt":"2015-12-14T20:28:52Z","lastAt":"2015-12-14T21:11:19Z","messageCount":5,"participants":["johan defries","Junio C Hamano","Jeff King"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"274415","messageId":"CALibRqFajuBuv9ooaBWL1kUzaVps2WfodqucyHni2ggv6JpwDg@mail.gmail.com","threadId":"40995","inReplyTo":null,"subject":"compile error in Git v2.7.0-rc0","fromName":"johan defries","fromEmail":"johandefries@gmail.com","sentAt":"2015-12-14T20:28:52Z","receivedAt":"2015-12-14T20:28:52Z","isPatch":false,"sender":{"key":"johandefries@gmail.com","avatar":null},"body":"Probably because I have NO_IPV6 defined.\n\nident.c: In function ‘canonical_name’:\nident.c:89:37: error: ‘buf’ undeclared (first use in this function)\n  struct hostent *he = gethostbyname(buf);\n                                     ^\nident.c:89:37: note: each undeclared identifier is reported only once\nfor each function it appears in\nmake: *** [ident.o] Fout 1\n"},{"id":"274417","messageId":"xmqqvb80ix9u.fsf@gitster.mtv.corp.google.com","threadId":"40995","inReplyTo":"CALibRqFajuBuv9ooaBWL1kUzaVps2WfodqucyHni2ggv6JpwDg@mail.gmail.com","subject":"Re: compile error in Git v2.7.0-rc0","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2015-12-14T20:35:25Z","receivedAt":"2015-12-14T20:35:25Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"johan defries <johandefries@gmail.com> writes:\n\n> Probably because I have NO_IPV6 defined.\n>\n> ident.c: In function ‘canonical_name’:\n> ident.c:89:37: error: ‘buf’ undeclared (first use in this function)\n>   struct hostent *he = gethostbyname(buf);\n>                                      ^\n> ident.c:89:37: note: each undeclared identifier is reported only once\n> for each function it appears in\n> make: *** [ident.o] Fout 1\n\nThanks.  This should perhaps do?\n\n ident.c | 1 +\n 1 file changed, 1 insertion(+)\n\ndiff --git a/ident.c b/ident.c\nindex 4e7f99d..2900879 100644\n--- a/ident.c\n+++ b/ident.c\n@@ -86,6 +86,7 @@ static int canonical_name(const char *host, struct strbuf *out)\n \t\tfreeaddrinfo(ai);\n \t}\n #else\n+\tchar buf[1024];\n \tstruct hostent *he = gethostbyname(buf);\n \tif (he && strchr(he->h_name, '.')) {\n \t\tstrbuf_addstr(out, he->h_name);\n"},{"id":"274423","messageId":"20151214204624.GA14788@sigill.intra.peff.net","threadId":"40995","inReplyTo":"xmqqvb80ix9u.fsf@gitster.mtv.corp.google.com","subject":"Re: compile error in Git v2.7.0-rc0","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2015-12-14T20:46:25Z","receivedAt":"2015-12-14T20:46:25Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Mon, Dec 14, 2015 at 12:35:25PM -0800, Junio C Hamano wrote:\n\n> johan defries <johandefries@gmail.com> writes:\n> \n> > Probably because I have NO_IPV6 defined.\n> >\n> > ident.c: In function ‘canonical_name’:\n> > ident.c:89:37: error: ‘buf’ undeclared (first use in this function)\n> >   struct hostent *he = gethostbyname(buf);\n> >                                      ^\n> > ident.c:89:37: note: each undeclared identifier is reported only once\n> > for each function it appears in\n> > make: *** [ident.o] Fout 1\n> \n> Thanks.  This should perhaps do?\n> \n>  ident.c | 1 +\n>  1 file changed, 1 insertion(+)\n> \n> diff --git a/ident.c b/ident.c\n> index 4e7f99d..2900879 100644\n> --- a/ident.c\n> +++ b/ident.c\n> @@ -86,6 +86,7 @@ static int canonical_name(const char *host, struct strbuf *out)\n>  \t\tfreeaddrinfo(ai);\n>  \t}\n>  #else\n> +\tchar buf[1024];\n>  \tstruct hostent *he = gethostbyname(buf);\n>  \tif (he && strchr(he->h_name, '.')) {\n>  \t\tstrbuf_addstr(out, he->h_name);\n\nWhoops. Looks like we didn't test the NO_IPV6 code path.\n\nI don't think that fix is right, though. We should be passing \"host\" to\ngethostbyname.\n\n-Peff\n"},{"id":"274424","messageId":"20151214205241.GB14788@sigill.intra.peff.net","threadId":"40995","inReplyTo":"20151214204624.GA14788@sigill.intra.peff.net","subject":"Re: compile error in Git v2.7.0-rc0","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2015-12-14T20:52:41Z","receivedAt":"2015-12-14T20:52:41Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Mon, Dec 14, 2015 at 03:46:25PM -0500, Jeff King wrote:\n\n> I don't think that fix is right, though. We should be passing \"host\" to\n> gethostbyname.\n\nHere it is in patch form. It can go on top of ep/ident-with-getaddrinfo.\n\n-- >8 --\nSubject: [PATCH] ident: fix undefined variable when NO_IPV6 is set\n\nCommit 00bce77 (ident.c: add support for IPv6, 2015-11-27)\nmoved the \"gethostbyname\" call out of \"add_domainname\" and\ninto the helper function \"canonical_name\". But when moving\nthe code, it forgot that the \"buf\" variable is passed as\n\"host\" in the helper.\n\nReported-by: johan defries <johandefries@gmail.com>\nSigned-off-by: Jeff King <peff@peff.net>\n---\n ident.c | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/ident.c b/ident.c\nindex 4e7f99d..00a62e0 100644\n--- a/ident.c\n+++ b/ident.c\n@@ -86,7 +86,7 @@ static int canonical_name(const char *host, struct strbuf *out)\n \t\tfreeaddrinfo(ai);\n \t}\n #else\n-\tstruct hostent *he = gethostbyname(buf);\n+\tstruct hostent *he = gethostbyname(host);\n \tif (he && strchr(he->h_name, '.')) {\n \t\tstrbuf_addstr(out, he->h_name);\n \t\tstatus = 0;\n-- \n2.7.0.rc0.348.g8e7037f\n"},{"id":"274430","messageId":"CAPc5daWWSNRdMSaQvakkK=mA_626QfuafmU5SkDTRC9kZpKzSw@mail.gmail.com","threadId":"40995","inReplyTo":"20151214205241.GB14788@sigill.intra.peff.net","subject":"Re: compile error in Git v2.7.0-rc0","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2015-12-14T21:11:19Z","receivedAt":"2015-12-14T21:11:19Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"On Mon, Dec 14, 2015 at 12:52 PM, Jeff King <peff@peff.net> wrote:\n> On Mon, Dec 14, 2015 at 03:46:25PM -0500, Jeff King wrote:\n>\n>> I don't think that fix is right, though. We should be passing \"host\" to\n>> gethostbyname.\n>\n> Here it is in patch form. It can go on top of ep/ident-with-getaddrinfo.\n\n\nThanks.\n\nI recall you were looking for a brown-paper-bag earlier.\nWhen you are done with it, could you pass it to me ;-)?\n"}]}