{"thread":{"id":"55402","subject":"Git 2.31.1, Solaris and error: conflicting types for 'inet_ntop'","startedAt":"2021-03-28T00:27:19Z","lastAt":"2021-03-28T07:23:31Z","messageCount":5,"participants":["Jeffrey Walton","brian m. carlson","Jeff King"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"420321","messageId":"CAH8yC8nUpHP4iX-iQqMqX4wR6sMZO2MQv9fBVVTSys67_oGX0A@mail.gmail.com","threadId":"55402","inReplyTo":null,"subject":"Git 2.31.1, Solaris and error: conflicting types for 'inet_ntop'","fromName":"Jeffrey Walton","fromEmail":"noloader@gmail.com","sentAt":"2021-03-28T00:18:37Z","receivedAt":"2021-03-28T00:27:19Z","isPatch":false,"sender":{"key":"noloader@gmail.com","avatar":null},"body":"Hi Everyone,\n\nI'm building the latest Git on Solaris 11.3. I use this patch for\nSolaris: https://github.com/noloader/Build-Scripts/blob/master/patch/git.patch.\nIt ensures -lresolv -lsocket -lnsl (in that order).\n\nThe build is having some trouble:\n\n/bin/gcc -o kwset.o -c -MF ./.depend/kwset.o.d -MQ kwset.o -MMD -MP\n-I/usr/local/include -DNDEBUG -DNO_UNALIGNED_LOADS=1 -g2 -O2 -m64\n-march=native -fPIC -pthread -I. -D__EXTENSIONS__ -D__sun__\n-DGIT_HOST_CPU=\"\\\"i86pc\\\"\" -DUSE_LIBPCRE2 -I/usr/local/include\n-DHAVE_ALLOCA_H -I/usr/local/include -DUSE_CURL_FOR_IMAP_SEND\n-I/usr/local/include -I/usr/local/include -I/usr/local/include\n-I/usr/local/include -DNO_D_TYPE_IN_DIRENT -DNO_INET_NTOP\n-DNO_INET_PTON -DSHA1_DC -DSHA1DC_NO_STANDARD_INCLUDES\n-DSHA1DC_INIT_SAFE_HASH_DEFAULT=0\n-DSHA1DC_CUSTOM_INCLUDE_SHA1_C=\"\\\"cache.h\\\"\"\n-DSHA1DC_CUSTOM_INCLUDE_UBC_CHECK_C=\"\\\"git-compat-util.h\\\"\"\n-DSHA256_BLK  -DHAVE_PATHS_H -DHAVE_LIBCHARSET_H -DHAVE_STRINGS_H\n-DHAVE_DEV_TTY -DHAVE_CLOCK_GETTIME -DHAVE_CLOCK_MONOTONIC\n-DHAVE_GETDELIM  -DFREAD_READS_DIRECTORIES -Icompat/regex\n-DSHELL_PATH='\"/bin/bash\"' -DPAGER_ENV='\"LESS=FRX LV=-c\"'  kwset.c\nIn file included from cache.h:4:0,\n                 from json-writer.c:1:\ngit-compat-util.h:823:13: error: conflicting types for 'inet_ntop'\n const char *inet_ntop(int af, const void *src, char *dst, size_t size);\n             ^\nIn file included from cache.h:4:0,\n                 from ident.c:8:\ngit-compat-util.h:823:13: error: conflicting types for 'inet_ntop'\n const char *inet_ntop(int af, const void *src, char *dst, size_t size);\n             ^\nIn file included from git-compat-util.h:226:0,\n                 from cache.h:4,\n                 from ident.c:8:\n/usr/include/arpa/inet.h:43:20: note: previous declaration of\n'inet_ntop' was here\n extern const char *inet_ntop(int, const void *_RESTRICT_KYWD,\n                    ^\nIn file included from git-compat-util.h:226:0,\n                 from cache.h:4,\n                 from json-writer.c:1:\n/usr/include/arpa/inet.h:43:20: note: previous declaration of\n'inet_ntop' was here\n extern const char *inet_ntop(int, const void *_RESTRICT_KYWD,\n                    ^\nIn file included from cache.h:4:0,\n                 from hex.c:1:\ngit-compat-util.h:823:13: error: conflicting types for 'inet_ntop'\n const char *inet_ntop(int af, const void *src, char *dst, size_t size);\n             ^\nIn file included from git-compat-util.h:226:0,\n                 from cache.h:4,\n                 from hex.c:1:\n/usr/include/arpa/inet.h:43:20: note: previous declaration of\n'inet_ntop' was here\n extern const char *inet_ntop(int, const void *_RESTRICT_KYWD,\n                    ^\nIn file included from cache.h:4:0,\n                 from kwset.c:35:\ngit-compat-util.h:823:13: error: conflicting types for 'inet_ntop'\n const char *inet_ntop(int af, const void *src, char *dst, size_t size);\n             ^\nIn file included from git-compat-util.h:226:0,\n                 from cache.h:4,\n                 from kwset.c:35:\n/usr/include/arpa/inet.h:43:20: note: previous declaration of\n'inet_ntop' was here\n extern const char *inet_ntop(int, const void *_RESTRICT_KYWD,\n                    ^\ngmake: *** [hex.o] Error 1\n\nJeff\n"},{"id":"420322","messageId":"YF/RtL+TS6+DNCTk@camp.crustytoothpaste.net","threadId":"55402","inReplyTo":"CAH8yC8nUpHP4iX-iQqMqX4wR6sMZO2MQv9fBVVTSys67_oGX0A@mail.gmail.com","subject":"Re: Git 2.31.1, Solaris and error: conflicting types for 'inet_ntop'","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2021-03-28T00:45:40Z","receivedAt":"2021-03-28T00:47:31Z","isPatch":false,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"On 2021-03-28 at 00:18:37, Jeffrey Walton wrote:\n> Hi Everyone,\n> \n> I'm building the latest Git on Solaris 11.3. I use this patch for\n> Solaris: https://github.com/noloader/Build-Scripts/blob/master/patch/git.patch.\n> It ensures -lresolv -lsocket -lnsl (in that order).\n> \n> The build is having some trouble:\n> \n> /bin/gcc -o kwset.o -c -MF ./.depend/kwset.o.d -MQ kwset.o -MMD -MP\n> -I/usr/local/include -DNDEBUG -DNO_UNALIGNED_LOADS=1 -g2 -O2 -m64\n> -march=native -fPIC -pthread -I. -D__EXTENSIONS__ -D__sun__\n> -DGIT_HOST_CPU=\"\\\"i86pc\\\"\" -DUSE_LIBPCRE2 -I/usr/local/include\n> -DHAVE_ALLOCA_H -I/usr/local/include -DUSE_CURL_FOR_IMAP_SEND\n> -I/usr/local/include -I/usr/local/include -I/usr/local/include\n> -I/usr/local/include -DNO_D_TYPE_IN_DIRENT -DNO_INET_NTOP\n\nSo you're defining NO_INET_NTOP.\n\n> -DNO_INET_PTON -DSHA1_DC -DSHA1DC_NO_STANDARD_INCLUDES\n> -DSHA1DC_INIT_SAFE_HASH_DEFAULT=0\n> -DSHA1DC_CUSTOM_INCLUDE_SHA1_C=\"\\\"cache.h\\\"\"\n> -DSHA1DC_CUSTOM_INCLUDE_UBC_CHECK_C=\"\\\"git-compat-util.h\\\"\"\n> -DSHA256_BLK  -DHAVE_PATHS_H -DHAVE_LIBCHARSET_H -DHAVE_STRINGS_H\n> -DHAVE_DEV_TTY -DHAVE_CLOCK_GETTIME -DHAVE_CLOCK_MONOTONIC\n> -DHAVE_GETDELIM  -DFREAD_READS_DIRECTORIES -Icompat/regex\n> -DSHELL_PATH='\"/bin/bash\"' -DPAGER_ENV='\"LESS=FRX LV=-c\"'  kwset.c\n> In file included from cache.h:4:0,\n>                  from json-writer.c:1:\n> git-compat-util.h:823:13: error: conflicting types for 'inet_ntop'\n>  const char *inet_ntop(int af, const void *src, char *dst, size_t size);\n\nSo we're defining one here.\n\n> In file included from cache.h:4:0,\n>                  from ident.c:8:\n> git-compat-util.h:823:13: error: conflicting types for 'inet_ntop'\n>  const char *inet_ntop(int af, const void *src, char *dst, size_t size);\n>              ^\n> In file included from git-compat-util.h:226:0,\n>                  from cache.h:4,\n>                  from ident.c:8:\n> /usr/include/arpa/inet.h:43:20: note: previous declaration of\n> 'inet_ntop' was here\n>  extern const char *inet_ntop(int, const void *_RESTRICT_KYWD,\n\nAnd then so are your system headers.  You probably want to avoid setting\nthat option, and then things will probably work better.\n-- \nbrian m. carlson (he/him or they/them)\nHouston, Texas, US\n"},{"id":"420323","messageId":"CAH8yC8mSMZDjhbidruAh9t7QFsv6Yxqi1poNEXBT=Nn9+sB2hA@mail.gmail.com","threadId":"55402","inReplyTo":"YF/RtL+TS6+DNCTk@camp.crustytoothpaste.net","subject":"Re: Git 2.31.1, Solaris and error: conflicting types for 'inet_ntop'","fromName":"Jeffrey Walton","fromEmail":"noloader@gmail.com","sentAt":"2021-03-28T01:04:32Z","receivedAt":"2021-03-28T01:05:43Z","isPatch":false,"sender":{"key":"noloader@gmail.com","avatar":null},"body":"On Sat, Mar 27, 2021 at 8:45 PM brian m. carlson\n<sandals@crustytoothpaste.net> wrote:\n>\n> On 2021-03-28 at 00:18:37, Jeffrey Walton wrote:\n> > Hi Everyone,\n> >\n> > I'm building the latest Git on Solaris 11.3. I use this patch for\n> > Solaris: https://github.com/noloader/Build-Scripts/blob/master/patch/git.patch.\n> > It ensures -lresolv -lsocket -lnsl (in that order).\n> >\n> > The build is having some trouble:\n> >\n> > /bin/gcc -o kwset.o -c -MF ./.depend/kwset.o.d -MQ kwset.o -MMD -MP\n> > -I/usr/local/include -DNDEBUG -DNO_UNALIGNED_LOADS=1 -g2 -O2 -m64\n> > -march=native -fPIC -pthread -I. -D__EXTENSIONS__ -D__sun__\n> > -DGIT_HOST_CPU=\"\\\"i86pc\\\"\" -DUSE_LIBPCRE2 -I/usr/local/include\n> > -DHAVE_ALLOCA_H -I/usr/local/include -DUSE_CURL_FOR_IMAP_SEND\n> > -I/usr/local/include -I/usr/local/include -I/usr/local/include\n> > -I/usr/local/include -DNO_D_TYPE_IN_DIRENT -DNO_INET_NTOP\n>\n> So you're defining NO_INET_NTOP.\n>\n> > -DNO_INET_PTON -DSHA1_DC -DSHA1DC_NO_STANDARD_INCLUDES\n> > -DSHA1DC_INIT_SAFE_HASH_DEFAULT=0\n> > -DSHA1DC_CUSTOM_INCLUDE_SHA1_C=\"\\\"cache.h\\\"\"\n> > -DSHA1DC_CUSTOM_INCLUDE_UBC_CHECK_C=\"\\\"git-compat-util.h\\\"\"\n> > -DSHA256_BLK  -DHAVE_PATHS_H -DHAVE_LIBCHARSET_H -DHAVE_STRINGS_H\n> > -DHAVE_DEV_TTY -DHAVE_CLOCK_GETTIME -DHAVE_CLOCK_MONOTONIC\n> > -DHAVE_GETDELIM  -DFREAD_READS_DIRECTORIES -Icompat/regex\n> > -DSHELL_PATH='\"/bin/bash\"' -DPAGER_ENV='\"LESS=FRX LV=-c\"'  kwset.c\n> > In file included from cache.h:4:0,\n> >                  from json-writer.c:1:\n> > git-compat-util.h:823:13: error: conflicting types for 'inet_ntop'\n> >  const char *inet_ntop(int af, const void *src, char *dst, size_t size);\n>\n> So we're defining one here.\n>\n> > In file included from cache.h:4:0,\n> >                  from ident.c:8:\n> > git-compat-util.h:823:13: error: conflicting types for 'inet_ntop'\n> >  const char *inet_ntop(int af, const void *src, char *dst, size_t size);\n> >              ^\n> > In file included from git-compat-util.h:226:0,\n> >                  from cache.h:4,\n> >                  from ident.c:8:\n> > /usr/include/arpa/inet.h:43:20: note: previous declaration of\n> > 'inet_ntop' was here\n> >  extern const char *inet_ntop(int, const void *_RESTRICT_KYWD,\n>\n> And then so are your system headers.  You probably want to avoid setting\n> that option, and then things will probably work better.\n\nI see what happened... I stopped Autoreconfing so the configure.ac\nchanges were not picked up. The original configure is being used.\n\nI think Git is getting itself into that state.\n\nWithout the Autoreconf, I was able to sidestep the issue with:\n\nif [[ \"${IS_SOLARIS}\" -eq 1 ]]; then\n    CONFIG_OPTS+=(\"ac_cv_func_inet_ntop=yes\")\n    CONFIG_OPTS+=(\"ac_cv_func_inet_pton=yes\")\nfi\n\nJeff\n"},{"id":"420324","messageId":"YF/bMjJA2RguVguZ@camp.crustytoothpaste.net","threadId":"55402","inReplyTo":"CAH8yC8mSMZDjhbidruAh9t7QFsv6Yxqi1poNEXBT=Nn9+sB2hA@mail.gmail.com","subject":"Re: Git 2.31.1, Solaris and error: conflicting types for 'inet_ntop'","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2021-03-28T01:26:10Z","receivedAt":"2021-03-28T01:27:38Z","isPatch":false,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"On 2021-03-28 at 01:04:32, Jeffrey Walton wrote:\n> I see what happened... I stopped Autoreconfing so the configure.ac\n> changes were not picked up. The original configure is being used.\n> \n> I think Git is getting itself into that state.\n> \n> Without the Autoreconf, I was able to sidestep the issue with:\n> \n> if [[ \"${IS_SOLARIS}\" -eq 1 ]]; then\n>     CONFIG_OPTS+=(\"ac_cv_func_inet_ntop=yes\")\n>     CONFIG_OPTS+=(\"ac_cv_func_inet_pton=yes\")\n> fi\n\nMost developers don't use the autoconf stuff and just use the makefile.\nconfig.mak.uname doesn't have NO_INET_NTOP set for SunOS.\n\nIf the autoconf scripts or config.mak.uname need fixing, which is\npossible, a patch would definitely be welcome.\n-- \nbrian m. carlson (he/him or they/them)\nHouston, Texas, US\n"},{"id":"420370","messageId":"YGAuvmhBdz3txhXu@coredump.intra.peff.net","threadId":"55402","inReplyTo":"YF/bMjJA2RguVguZ@camp.crustytoothpaste.net","subject":"Re: Git 2.31.1, Solaris and error: conflicting types for 'inet_ntop'","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2021-03-28T07:22:38Z","receivedAt":"2021-03-28T07:23:31Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Sun, Mar 28, 2021 at 01:26:10AM +0000, brian m. carlson wrote:\n\n> On 2021-03-28 at 01:04:32, Jeffrey Walton wrote:\n> > I see what happened... I stopped Autoreconfing so the configure.ac\n> > changes were not picked up. The original configure is being used.\n> > \n> > I think Git is getting itself into that state.\n> > \n> > Without the Autoreconf, I was able to sidestep the issue with:\n> > \n> > if [[ \"${IS_SOLARIS}\" -eq 1 ]]; then\n> >     CONFIG_OPTS+=(\"ac_cv_func_inet_ntop=yes\")\n> >     CONFIG_OPTS+=(\"ac_cv_func_inet_pton=yes\")\n> > fi\n> \n> Most developers don't use the autoconf stuff and just use the makefile.\n> config.mak.uname doesn't have NO_INET_NTOP set for SunOS.\n> \n> If the autoconf scripts or config.mak.uname need fixing, which is\n> possible, a patch would definitely be welcome.\n\nThis all seemed vaguely familiar, and indeed it came up about a year\nago:\n\n  https://lore.kernel.org/git/CAH8yC8m3JFvEcfFF3z1rrRnEPK-adHGObmkOhNZiph7QJKUWqA@mail.gmail.com/\n\nMaybe worth resurrecting this patch (at the very least it needed a\nsignoff):\n\n  https://lore.kernel.org/git/CAH8yC8kaWXbN+RYMJnM9em7KKW54+N07JtyS1MZk0qppD=m2BA@mail.gmail.com/\n\n-Peff\n"}]}