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

Re: [PATCH] Makefile: suppress false positive warnings of empty format string.

From
Jeff King <peff@peff.net>
Date
Sep 30, 2013, 23:23 UTC
Message-ID
<20130930232349.GB23218@sigill.intra.peff.net>
In-Reply-To
<5249EF59.4080607@googlemail.com>
On Mon, Sep 30, 2013 at 11:38:33PM +0200, Stefan Beller wrote:
Show 8 quoted lines
> > To be honest, I'm surprised that "-Wall" doesn't create problems for
> > older "cc" implementations. We've had patches for compiling with
> > antique SUNWspro and MIPSpro compilers, and I sort of assumed that those
> > don't handle "-Wall". But maybe they do. Or maybe people doing that just
> > set CFLAGS themselves.
> 
> Well actually I do think people are encouraged to play around with their
> CFLAGS as much as they like. I do add link time optimisation usually.

Oh, absolutely. I didn't mean to give the impression that you should not tweak CFLAGS. That's what it's there for. I just meant that I do not recall seeing complaints from people on such compilers, so either it actually works, or they are savvy enough to tweak CFLAGS without making a complaint. Or they no longer exist. The patches I'm thinking of were from 2008, and the compilers and systems were old then.

Show 6 quoted lines
> However I do have the strong opinion that any serious project should
> compile without any warning/error with the standard compilers of
> the current time. That's why I started an attempt again to have
> -Wno-format-zero-length in there by default. Most of the people (I
> assume so) are using gcc. So it should build fine there without any
> warnings.
Yeah, I'd agree it is a good goal.
> Sure it should build without errors as well on other architectures, so
> I do understand the issue to check if we're really using gcc and can
> omit this flag if using another compiler.
Right, agreed.
> and here
> http://thread.gmane.org/gmane.comp.version-control.git/230806
Thanks, I didn't recall that one.

I still think if we are going to start doing gcc auto-detection in the Makefile, it is slightly less ugly to just tweak the few callsites to prevent the warning in the first place. I think gcc is being silly to warn about, but it is the path of least resistance and maintenance.

-Peff
Previous: Stefan Beller
Message 10 of 10 in “What's cooking in git.git (Jul 2013, #04; Thu, 11)”
  1. Junio C HamanoJul 11, 2013
  2. Makefile: suppress false positive warnings of empty format string.Stefan Beller, Sep 29, 2013
  3. Felipe ContrerasSep 29, 2013
  4. Ramsay JonesSep 29, 2013
  5. Jonathan NiederSep 29, 2013
  6. Jeff KingSep 30, 2013
  7. Jonathan NiederSep 30, 2013
  8. Jeff KingSep 30, 2013
  9. Stefan BellerSep 30, 2013
  10. Jeff KingSep 30, 2013

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.