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

Re: [PATCH 2/3] combine-diff: suppress a clang warning

From
John Keeping <john@keeping.me.uk>
Date
Feb 7, 2013, 08:41 UTC
Message-ID
<20130207084106.GB1342@serenity.lan>
In-Reply-To
<876224sqwk.fsf@catnip.gol.com>
On Thu, Feb 07, 2013 at 01:12:59PM +0900, Miles Bader wrote:
Show 11 quoted lines
> John Keeping <john@keeping.me.uk> writes:
> > I generally like to get rid of the pointless warnings so that the useful
> > ones can't hide in the noise.  Perhaps "CFLAGS += -Wno-string-plus-int"
> > would be better for this particular warning, but when there's only one
> > bit of code that triggers it, tweaking that seemed simpler.
> 
> An even better approach would be to file a bug against clang ... it
> really is a very ill-considered warning -- PTR + OFFS is not just
> valid C, it's _idiomatic_ in C for getting interior pointers into
> arrays -- and such a warning should never be enabled by default, or by
> any standard warning options.

It doesn't warn of PTR + OFFS, only STRING_LITERAL + OFFS. I agree that it's not a particularly useful warning but it was clearly introduced intentionally and appears to find real bugs [1] so I don't intend to argue about it with the Clang developers.

[1] http://article.gmane.org/gmane.comp.compilers.clang.scm/47203
John
Previous: Miles BaderNext: John Keeping
Message 17 of 20 in “Make Git compile warning-free with Clang”
  1. 0/3 Make Git compile warning-free with ClangJohn Keeping, Feb 3, 2013
  2. 1/3 fix clang -Wtautological-compare with unsigned enumJohn Keeping, Feb 3, 2013
  3. Jonathan NiederFeb 3, 2013
  4. 2/3 combine-diff: suppress a clang warningJohn Keeping, Feb 3, 2013
  5. Tay Ray ChuanFeb 3, 2013
  6. John KeepingFeb 3, 2013
  7. Junio C HamanoFeb 3, 2013
  8. John KeepingFeb 3, 2013
  9. Junio C HamanoFeb 3, 2013
  10. John KeepingFeb 3, 2013
  11. Junio C HamanoFeb 4, 2013
  12. t4038: add tests for "diff --cc --raw <trees>"John Keeping, Feb 5, 2013
  13. Junio C HamanoFeb 5, 2013
  14. t4038: add tests for "diff --cc --raw <trees>"John Keeping, Feb 5, 2013
  15. Junio C HamanoFeb 5, 2013
  16. Miles BaderFeb 7, 2013
  17. John KeepingFeb 7, 2013
  18. 3/3 builtin/apply: tighten (dis)similarity index parsingJohn Keeping, Feb 3, 2013
  19. Junio C HamanoFeb 3, 2013
  20. Antoine PelisseFeb 3, 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.