threads / patch / 50112

patchSpecify -Wformat along with -Wformat-security

Subject: [PATCH] Specify -Wformat along with -Wformat-security

## tl;dr

3 messages between Dec 27, 2018 and Dec 27, 2018. Diffs are folded; open one to read it.

replies: 2people: 2as markdown or json

Masaya Suzuki· Dec 27, 2018, 06:58 UTC · lore
Without -Wformat, -Wformat-security won't work.
> cc1: error: -Wformat-security ignored without -Wformat [-Werror=format-security]
Signed-off-by: Masaya Suzuki <masayasuzuki@google.com>
---
 config.mak.dev | 1 +
 1 file changed, 1 insertion(+)
Show changes to config.mak.dev +1 −0
diff --git a/config.mak.dev b/config.mak.dev
index bbeeff44f..aae9db67d 100644
--- a/config.mak.dev
+++ b/config.mak.dev
@@ -7,6 +7,7 @@ CFLAGS += -pedantic
 CFLAGS += -DUSE_PARENS_AROUND_GETTEXT_N=0
 endif
 CFLAGS += -Wdeclaration-after-statement
+CFLAGS += -Wformat
 CFLAGS += -Wformat-security
 CFLAGS += -Wno-format-zero-length
 CFLAGS += -Wold-style-definition
-- 
2.20.1.415.g653613c723-goog
Duy Nguyen· Dec 27, 2018, 18:35 UTC · re: Masaya Suzuki · lore

Re: [PATCH] Specify -Wformat along with -Wformat-security

On Thu, Dec 27, 2018 at 7:18 PM Masaya Suzuki <masayasuzuki@google.com> wrote:
>
> Without -Wformat, -Wformat-security won't work.
>
> > cc1: error: -Wformat-security ignored without -Wformat [-Werror=format-security]
Compiler name and version?
Show 21 quoted lines
>
> Signed-off-by: Masaya Suzuki <masayasuzuki@google.com>
> ---
>  config.mak.dev | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/config.mak.dev b/config.mak.dev
> index bbeeff44f..aae9db67d 100644
> --- a/config.mak.dev
> +++ b/config.mak.dev
> @@ -7,6 +7,7 @@ CFLAGS += -pedantic
>  CFLAGS += -DUSE_PARENS_AROUND_GETTEXT_N=0
>  endif
>  CFLAGS += -Wdeclaration-after-statement
> +CFLAGS += -Wformat
>  CFLAGS += -Wformat-security
>  CFLAGS += -Wno-format-zero-length
>  CFLAGS += -Wold-style-definition
> --
> 2.20.1.415.g653613c723-goog
>
-- 
Duy
Masaya Suzuki· Dec 27, 2018, 18:46 UTC · re: Duy Nguyen · lore

Re: [PATCH] Specify -Wformat along with -Wformat-security

On Thu, Dec 27, 2018 at 10:36 AM Duy Nguyen <pclouds@gmail.com> wrote:
Show 8 quoted lines
>
> On Thu, Dec 27, 2018 at 7:18 PM Masaya Suzuki <masayasuzuki@google.com> wrote:
> >
> > Without -Wformat, -Wformat-security won't work.
> >
> > > cc1: error: -Wformat-security ignored without -Wformat [-Werror=format-security]
>
> Compiler name and version?
I'm not familar with the tools, so please be patient.
According to Makefile, `CC = cc`. With `cc --version`, it says:

cc (Debian 7.3.0-5) 7.3.0 Copyright (C) 2017 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Jonathan said there was the same patch. Looks like https://public-inbox.org/git/20181012184037.15076-1-t.gummerer@gmail.com/. I'll check my config again.

← back to recent threads