]> git.ipfire.org Git - people/ms/ipfire-3.x.git/blob - gcc/patches/11_all_gcc49_default-warn-format-security.patch
gcc: Update to version 4.9.1
[people/ms/ipfire-3.x.git] / gcc / patches / 11_all_gcc49_default-warn-format-security.patch
1 Enable -Wformat and -Wformat-security by default.
2
3
4 --- a/gcc/c-family/c.opt
5 +++ b/gcc/c-family/c.opt
6 @@ -412,7 +412,7 @@ C ObjC C++ ObjC++ Var(warn_format_nonliteral) Warning LangEnabledBy(C ObjC C++ O
7 Warn about format strings that are not literals
8
9 Wformat-security
10 -C ObjC C++ ObjC++ Var(warn_format_security) Warning LangEnabledBy(C ObjC C++ ObjC++,Wformat=, warn_format >= 2, 0)
11 +C ObjC C++ ObjC++ Var(warn_format_security) Init(1) Warning LangEnabledBy(C ObjC C++ ObjC++,Wformat=, warn_format >= 2, 0)
12 Warn about possible security problems with format functions
13
14 Wformat-y2k
15 @@ -424,7 +424,7 @@ C ObjC C++ ObjC++ Var(warn_format_zero_length) Warning LangEnabledBy(C ObjC C++
16 Warn about zero-length formats
17
18 Wformat=
19 -C ObjC C++ ObjC++ Joined RejectNegative UInteger Var(warn_format) Warning LangEnabledBy(C ObjC C++ ObjC++,Wall, 1, 0)
20 +C ObjC C++ ObjC++ Joined RejectNegative UInteger Var(warn_format) Init(1) Warning LangEnabledBy(C ObjC C++ ObjC++,Wall, 1, 0)
21 Warn about printf/scanf/strftime/strfmon format string anomalies
22
23 Wignored-qualifiers
24 --- a/gcc/doc/gcc.info
25 +++ b/gcc/doc/gcc.info
26 @@ -3451,6 +3451,8 @@ compiler warns that an unrecognized option is present.
27 '-Wno-format-contains-nul', '-Wno-format-extra-args', and
28 '-Wno-format-zero-length'. '-Wformat' is enabled by '-Wall'.
29
30 + This option is enabled by default in Gentoo.
31 +
32 '-Wno-format-contains-nul'
33 If '-Wformat' is specified, do not warn about format strings
34 that contain NUL bytes.
35 @@ -3496,6 +3498,8 @@ compiler warns that an unrecognized option is present.
36 future warnings may be added to '-Wformat-security' that are
37 not included in '-Wformat-nonliteral'.)
38
39 + This option is enabled by default in Gentoo.
40 +
41 '-Wformat-y2k'
42 If '-Wformat' is specified, also warn about 'strftime' formats
43 that may yield only a two-digit year.