git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Johannes Sixt <j.sixt@viscovery.net>
Cc: Michael Haggerty <mhagger@alum.mit.edu>,
	Junio C Hamano <gitster@pobox.com>,
	git discussion list <git@vger.kernel.org>,
	Michal Rokos <michal.rokos@nextsoft.cz>,
	Brandon Casey <casey@nrlssc.navy.mil>
Subject: Re: Breakage (?) in configure and git_vsnprintf()
Date: Mon, 12 Dec 2011 03:10:19 -0500	[thread overview]
Message-ID: <20111212081019.GA17725@sigill.intra.peff.net> (raw)
In-Reply-To: <4EE5B123.2030708@viscovery.net>

On Mon, Dec 12, 2011 at 08:45:39AM +0100, Johannes Sixt wrote:

> Am 12/12/2011 7:43, schrieb Jeff King:
> > I'll leave the issue of "-std=c89" triggering SNPRINTF_RETURNS_BOGUS to
> > people who know and care about autoconf. My gut is to say "don't do
> > that".
> 
> Right. But Michael's problem was actually that SNPRINTF_RETURNS_BOGUS was
> set incorrectly; his system has a working snprintf (or so I assume). The
> reason for the failure is that ./configure's test program produced a
> warning, and that warning was turned into an error due to -Werror. Without
> -Werror, the test program would have compiled successfully, and the
> working snprintf would have been detected.

Right, I understand that. But he has given a set of options that
shouldn't compile git at all (he tells the compiler not to use snprintf
via -std=c89, but we require that it exists, because even our
git_vsnprintf wrapper uses the underlying system vsnprintf).

So yes, the configure script is broken to detect the situation as
SNPRINTF_RETURNS_BOGUS and not "this platform doesn't have snprintf at
all"[1]. But I'm saying that the "we do not have snprintf at all" case
is not all that interesting: git needs it. So I'm not sure compiling
with -std=c89 really makes sense[2].

If somebody wants to make the configure script more accurate, I
certainly don't want to stop them. I'm just not sure it is worth
anybody's time in this case.

-Peff

[1] Yes, obviously we do actually have it, but it is somewhat a fluke
    that it works. We tell the compiler during the compile phase that we
    don't have it, but then during the link phase it is magically
    available in libc.

[2] I can convince git to compile on recent Linux with gcc using
    CFLAGS='-std=c89 -Dinline='.  Turning on "-Wall -Werror" doesn't
    work because all of the inline functions appear to be unused
    statics.  But if I understand Michael's problem correctly, wouldn't
    we be missing the prototype for snprintf, which could cause subtle
    errors?

  reply	other threads:[~2011-12-12  8:10 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-11 18:42 Breakage (?) in configure and git_vsnprintf() Michael Haggerty
2011-12-12  6:43 ` Jeff King
2011-12-12  7:45   ` Johannes Sixt
2011-12-12  8:10     ` Jeff King [this message]
2011-12-12  8:23   ` Junio C Hamano
2011-12-12  9:30   ` Andreas Schwab
2011-12-12 14:25     ` Jeff King
2011-12-12 23:25       ` Brandon Casey
2011-12-12 10:25   ` Michael Haggerty
2011-12-12 21:56   ` Jonathan Nieder

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=20111212081019.GA17725@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=casey@nrlssc.navy.mil \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=j.sixt@viscovery.net \
    --cc=mhagger@alum.mit.edu \
    --cc=michal.rokos@nextsoft.cz \
    /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).