Here is an updated version of the gcc-default-format-security.diff patch that enables -Wformat=1 and -Wformat-security by default, but honors users' -Wformat arguments to override the default.
This fixes the following gcc testcase failures: -FAIL: gcc.dg/format/nonlit-2.c -Wformat=0 non-literal (test for warnings, line 11) -FAIL: gcc.dg/format/nonlit-2.c -Wformat=0 non-literal (test for warnings, line 12) -FAIL: gcc.dg/format/nonlit-2.c -DWIDE -Wformat=0 non-literal (test for warnings, line 11) -FAIL: gcc.dg/format/nonlit-2.c -DWIDE -Wformat=0 non-literal (test for warnings, line 12) -FAIL: gcc.dg/format/opt-1.c -Wformat=0 ignored (test for warnings, line ) -FAIL: gcc.dg/format/opt-1.c -DWIDE -Wformat=0 ignored (test for warnings, line ) -FAIL: gcc.dg/format/opt-2.c -Wformat=0 ignored (test for warnings, line ) -FAIL: gcc.dg/format/opt-2.c -DWIDE -Wformat=0 ignored (test for warnings, line ) -FAIL: gcc.dg/format/opt-3.c -Wformat=0 ignored (test for warnings, line ) -FAIL: gcc.dg/format/opt-3.c -DWIDE -Wformat=0 ignored (test for warnings, line ) -FAIL: gcc.dg/format/opt-4.c -Wformat=0 ignored (test for warnings, line ) -FAIL: gcc.dg/format/opt-4.c -DWIDE -Wformat=0 ignored (test for warnings, line ) -FAIL: gcc.dg/format/opt-5.c -Wformat=0 ignored (test for warnings, line ) -FAIL: gcc.dg/format/opt-5.c -DWIDE -Wformat=0 ignored (test for warnings, line ) -FAIL: gcc.dg/format/opt-6.c -Wformat=0 ignored (test for warnings, line ) -FAIL: gcc.dg/format/opt-6.c -DWIDE -Wformat=0 ignored (test for warnings, line ) -FAIL: gcc.dg/format/plus-1.c -Wformat=0 non-constant addend (test for warnings, line 16) -FAIL: gcc.dg/format/plus-1.c -Wformat=0 minus constant (test for warnings, line 18) -FAIL: gcc.dg/format/plus-1.c -Wformat=0 negative addend (test for warnings, line 19) -FAIL: gcc.dg/format/plus-1.c -DWIDE -Wformat=0 non-constant addend (test for warnings, line 16) -FAIL: gcc.dg/format/plus-1.c -DWIDE -Wformat=0 minus constant (test for warnings, line 18) -FAIL: gcc.dg/format/plus-1.c -DWIDE -Wformat=0 negative addend (test for warnings, line 19) Note that this patch is for gcc-4.9 and applies on top of the modified patch to enable -fstack-protector-strong by default in bug 1317307. I'll prepare a patch for gcc-4.8 for use in an SRU in a bit. I've also added tests to lp:qa-regression-testing to ensure that passed command line arguments are honored over the default. ** Patch added: "gcc-default-format-security.diff" https://bugs.launchpad.net/ubuntu/+source/gcc-4.9/+bug/1317305/+attachment/4111586/+files/gcc-default-format-security.diff -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1317305 Title: -Wno-format is not honored To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/gcc-4.8/+bug/1317305/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs