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

Petr Štetiar ynezz at true.cz
Sat Nov 30 09:04:40 EST 2019


Rosen Penev <rosenp at gmail.com> [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?):

  -Werror=format-security 
  -Werror=format-nonliteral

as default in all C projects in order to proactively prevent similar issues in
the future?

uci has already GitLab CI, so this could be catched automatically after the
push to master in case the maintainer forgets to compile check it himself.

-- ynezz

_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel



More information about the openwrt-devel mailing list