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
Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Date
Sep 29, 2013, 15:23 UTC
Message-ID
<5248460A.40005@ramsay1.demon.co.uk>
In-Reply-To
<CAMP44s069BUJiv1K3a2nkwT1A8fo=Vn0+8WFePHqBg_PBx_17g@mail.gmail.com>
On 29/09/13 16:07, Felipe Contreras wrote:
Show 22 quoted lines
> On Sun, Sep 29, 2013 at 7:08 AM, Stefan Beller
> <stefanbeller@googlemail.com> wrote:
>> Signed-off-by: Stefan Beller <stefanbeller@googlemail.com>
>> ---
>>  Makefile | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/Makefile b/Makefile
>> index de3d72c..60afa51 100644
>> --- a/Makefile
>> +++ b/Makefile
>> @@ -349,7 +349,7 @@ GIT-VERSION-FILE: FORCE
>>
>>  # CFLAGS and LDFLAGS are for the users to override from the command line.
>>
>> -CFLAGS = -g -O2 -Wall
>> +CFLAGS = -g -O2 -Wall -Wno-format-zero-length
> 
> Oh yes please.
> 
> However, somebody mentioned that this might break compilers other than
> gcc, but perhaps we can do what Linux does:
I simply added:
    CFLAGS+=-Wno-format-zero-length

to my config.mak file. I had originally intended to do so conditionally, depending on the compiler being gcc, but I found that clang and tcc just ignored it ...

> cc-disable-warning = $(call try-run,\
> $(CC) $(CFLAGS) -W$(strip $(1)) -c -x c /dev/null -o "$$TMP",-Wno-$(strip $(1)))
> 
> CFLAGS = -g -O2 -Wall $(call cc-disable-warning,format-zero-length,)

ATB, Ramsay Jones

Previous: Felipe ContrerasNext: Jonathan Nieder
Message 4 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.