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

Re: [PATCH] config.mak.dev: add -Wformat

From
Jonathan Nieder <jrnieder@gmail.com>
Date
Jan 3, 2019, 18:54 UTC
Message-ID
<20190103185427.GA237830@google.com>
In-Reply-To
<xmqqa7khisue.fsf@gitster-ct.c.googlers.com>
Hi,
Junio C Hamano wrote:
Show 39 quoted lines
> I think it is a good idea to give fallback/redundancy for this
> case.  I do not have strong opinion between -Wall and -Wformat,
> but I'd probably vote for the former if pressed.
>
> -- >8 --
> From: Thomas Gummerer <t.gummerer@gmail.com>
> Date: Fri, 12 Oct 2018 19:40:37 +0100
> Subject: [PATCH] config.mak.dev: add -Wformat
>
> 801fa63a90 ("config.mak.dev: add -Wformat-security", 2018-09-08)
> added the "-Wformat-security" to the flags set in config.mak.dev.
> In the gcc man page this is documented as:
>
>          If -Wformat is specified, also warn about uses of format
>          functions that represent possible security problems.  [...]
>
> The commit did however not add the "-Wformat" flag, but instead
> relied on the fact that "-Wall" is set in the Makefile by default
> and that "-Wformat" is part of "-Wall".
>
> Unfortunately, those who use config.mak.autogen generated with the
> autoconf to configure toolchain do *not* get "-Wall" in their CFLAGS
> and the added -Wformat-security had no effect.  Worse yet, newer
> versions of gcc (gcc 8.2.1 in this particular case) warn about the
> lack of "-Wformat" and thus compilation fails only with this option
> set.
>
> We could fix it by adding "-Wformat", but in general we do want all
> checks included in "-Wall", so let's add it to config.mak.dev to
> cover more cases.
>
> Signed-off-by: Thomas Gummerer <t.gummerer@gmail.com>
> Helped-by: Jeff King <peff@peff.net>
> Helped-by: Jonathan Nieder <jrnieder@gmail.com>
> [jc: s/-Wformat/-Wall/]
> Signed-off-by: Junio C Hamano <gitster@pobox.com>
> ---
>  config.mak.dev | 1 +
>  1 file changed, 1 insertion(+)
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Thanks for tying up this loose end.
Previous: Junio C HamanoNext: Thomas Gummerer
Message 8 of 11 in “config.mak.dev: add -Wformat”
  1. config.mak.dev: add -WformatThomas Gummerer, Oct 12, 2018
  2. Jeff KingOct 12, 2018
  3. Jonathan NiederOct 12, 2018
  4. Jeff KingOct 12, 2018
  5. Thomas GummererOct 12, 2018
  6. Jonathan NiederDec 27, 2018
  7. Junio C HamanoJan 3, 2019
  8. Jonathan NiederJan 3, 2019
  9. Thomas GummererJan 6, 2019
  10. Junio C HamanoJan 7, 2019
  11. Jonathan NiederJan 7, 2019

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.