Re: [OpenWrt-Devel] default compiler hardening options for all C projects [Was: Re: [PATCH] uci: Fix Wformat-nonliteral warning]

2019-11-30 Thread Rosen Penev
On Sat, Nov 30, 2019 at 7:41 AM Petr Štetiar wrote: > > Petr Štetiar [2019-11-30 15:04:40]: > > > Wouldn't it make sense to enable following hardening flags (maybe consider > > others as well?): > > > > -Werror=format-security > > -Werror=format-nonliteral > > FYI, following uci patch: > > d

Re: [OpenWrt-Devel] default compiler hardening options for all C projects [Was: Re: [PATCH] uci: Fix Wformat-nonliteral warning]

2019-11-30 Thread Rosen Penev
> > >> Wouldn't it make sense to enable following hardening flags (maybe consider >> others as well?): >> >> -Werror=format-security >> -Werror=format-nonliteral Actually the flag I used was -Werror=format=2. It includes all of them. The nonliteral warning is not applicable everywhere. In so

Re: [OpenWrt-Devel] default compiler hardening options for all C projects [Was: Re: [PATCH] uci: Fix Wformat-nonliteral warning]

2019-11-30 Thread Petr Štetiar
Petr Štetiar [2019-11-30 15:04:40]: > Wouldn't it make sense to enable following hardening flags (maybe consider > others as well?): > > -Werror=format-security > -Werror=format-nonliteral FYI, following uci patch: diff --git a/CMakeLists.txt b/CMakeLists.txt index 92adf4a47121..56a14e2

[OpenWrt-Devel] default compiler hardening options for all C projects [Was: Re: [PATCH] uci: Fix Wformat-nonliteral warning]

2019-11-30 Thread Petr Štetiar
Rosen Penev [2019-11-29 13:07:29]: Hi, > A constant expression needs to be passed so that GCC can determine the > types of the format properly. indeed, good catch! > -Werror=format-nonliteral Wouldn't it make sense to enable following hardening flags (maybe consider others as well?): -Werr