git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: compile error in Git v2.7.0-rc0

From
Junio C Hamano <gitster@pobox.com>
Date
Dec 14, 2015, 20:35 UTC
Message-ID
<xmqqvb80ix9u.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<CALibRqFajuBuv9ooaBWL1kUzaVps2WfodqucyHni2ggv6JpwDg@mail.gmail.com>
johan defries <johandefries@gmail.com> writes:
Show 9 quoted lines
> Probably because I have NO_IPV6 defined.
>
> ident.c: In function ‘canonical_name’:
> ident.c:89:37: error: ‘buf’ undeclared (first use in this function)
>   struct hostent *he = gethostbyname(buf);
>                                      ^
> ident.c:89:37: note: each undeclared identifier is reported only once
> for each function it appears in
> make: *** [ident.o] Fout 1
Thanks.  This should perhaps do?
 ident.c | 1 +
 1 file changed, 1 insertion(+)
diff --git a/ident.c b/ident.c
index 4e7f99d..2900879 100644
--- a/ident.c
+++ b/ident.c
@@ -86,6 +86,7 @@ static int canonical_name(const char *host, struct strbuf *out)
 		freeaddrinfo(ai);
 	}
 #else
+	char buf[1024];
 	struct hostent *he = gethostbyname(buf);
 	if (he && strchr(he->h_name, '.')) {
 		strbuf_addstr(out, he->h_name);
Previous: johan defriesNext: Jeff King
Message 2 of 5 in “compile error in Git v2.7.0-rc0”
  1. johan defriesDec 14, 2015
  2. Junio C HamanoDec 14, 2015
  3. Jeff KingDec 14, 2015
  4. Jeff KingDec 14, 2015
  5. Junio C HamanoDec 14, 2015

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.