git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Jeffrey Walton <noloader@gmail.com>
Cc: Git List <git@vger.kernel.org>
Subject: Re: git-compat-util.h:798:13: error: conflicting types for ‘inet_ntop’
Date: Mon, 3 Feb 2020 03:54:05 -0500	[thread overview]
Message-ID: <20200203085405.GC2164@coredump.intra.peff.net> (raw)
In-Reply-To: <CAH8yC8mh0gysNz3Dbrph0f8KZ8DEWaH-6rWg6fSOD-_aGh3=3A@mail.gmail.com>

On Sat, Feb 01, 2020 at 07:12:21AM -0500, Jeffrey Walton wrote:

> Maybe the include should be <arpa/inet.h> on Sun systems?

It is included already. I think the real problem is that we are
declaring our own replacement inet_ntop(), which then conflicts with the
system one.

> I was able to hack around it with the following after configure:
> 
>     # Solaris 11.3 work-around. The OS has inet_ntop and inet_pton
>     for file in $(find "$PWD" -name 'Makefile')
>     do
>         sed '/ifdef NO_INET_NTOP/,+3 d' "$file" > "$file.fixed"
>         mv "$file.fixed" "$file"
>         sed '/ifdef NO_INET_PTON/,+3 d' "$file" > "$file.fixed"
>         mv "$file.fixed" "$file"
>     done

As you found there's a knob for this already. Building with:

  make NO_INET_NTOP= NO_INET_PTON=

to clear those flags would probably work (as would putting those
variables in your config.mak file).

But having those variables unset is already the default. The root of the
problem is likely that the autoconf test seems to get the wrong result
on Solaris (another workaround would be to remove them from
config.mak.autogen, but that will get obliterated next time you run
./configure).

The real fix would be teaching configure.ac to check for the correct
libraries (it looks like it has a -lsocket test already; I'm not sure if
that isn't being used in the test-compile for inet_ntop(), or if we need
to also be adding libraries like -lnsl).

I suspect that running autoconf with CFLAGS='-lsocket -lnsl' in the
environment might also make the problem go away, but it's been a long
enough time since I touched anything related to autoconf that I'm not
sure.

This also seems eerily familiar:

  https://lore.kernel.org/git/CAH8yC8kOj5a5PN4V7mj7xZPoNDr-MH-CkirxRKyfx1-qAvfpqQ@mail.gmail.com/

:) I second Junio's notion there that you may be better off skipping
./configure entirely.

-Peff

  parent reply	other threads:[~2020-02-03  8:54 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-01 11:39 git-compat-util.h:798:13: error: conflicting types for ‘inet_ntop’ Jeffrey Walton
2020-02-01 12:12 ` Jeffrey Walton
2020-02-01 12:34   ` Jeffrey Walton
2020-02-03  8:54   ` Jeff King [this message]
2020-02-03  8:59     ` Jeffrey Walton
2020-02-03 10:01       ` Jeff King
2020-02-03 10:46     ` Jeffrey Walton
2020-02-03 11:02       ` Jeff King

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200203085405.GC2164@coredump.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=noloader@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.
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 NNTP newsgroup(s).