Message271354
GCC’s -Wformat options are documented at <https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wformat-321>. We already enable -Wall by default, which implicitly enables -Wformat, but not -Wformat=2. Apparently, -Wformat=2 enables -Wformat-security, so you shouldn’t have to manually enable it.
The -Wformat-security option enables warnings for stuff like printf(variable), without any extra arguments. Such a call could easily be changed, even if it is not a genuine problem. So I wouldn’t have a problem enabling this warning by default. (See also Issue 23545 proposing a few other warnings.)
However I am not convinced it is worth working around the -Wformat-nonliteral warnings, given that all the warnings given above were false positives, and the general workaround would need six or seven preprocessor lines. |
|
Date |
User |
Action |
Args |
2016-07-26 09:47:38 | martin.panter | set | recipients:
+ martin.panter, pitrou, vstinner, python-dev, serhiy.storchaka, Jeffrey.Walton |
2016-07-26 09:47:38 | martin.panter | set | messageid: <1469526458.69.0.577420829967.issue20948@psf.upfronthosting.co.za> |
2016-07-26 09:47:38 | martin.panter | link | issue20948 messages |
2016-07-26 09:47:38 | martin.panter | create | |
|