From ab7bee2bcb8c8ad131cec611e67c0b93fba2d32b Mon Sep 17 00:00:00 2001 From: Simon Ruderich Date: Sun, 16 Sep 2012 18:58:06 +0200 Subject: [PATCH] Accept -Wformat=2 because it implies -Wformat. --- bin/blhc | 3 ++- t/logs/good | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/bin/blhc b/bin/blhc index 9525baa..b77420d 100755 --- a/bin/blhc +++ b/bin/blhc @@ -182,7 +182,7 @@ my @def_cflags = ( '-O(?:2|3)', ); my @def_cflags_format = ( - '-Wformat', + '-Wformat(?:=2)?', # -Wformat=2 implies -Wformat, accept it too '-Werror=format-security', # implies -Wformat-security ); my @def_cflags_fortify = ( @@ -251,6 +251,7 @@ my @flag_refs_all = ( # stores string values of flag regexps above, see compile_flag_regexp(). my %flag_renames = ( '-O(?:2|3)' => '-O2', + '-Wformat(?:=2)?' => '-Wformat', '-Wl,(?:-z,)?relro' => '-Wl,-z,relro', '-Wl,(?:-z,)?now' => '-Wl,-z,now', ); diff --git a/t/logs/good b/t/logs/good index 0be962c..9837879 100644 --- a/t/logs/good +++ b/t/logs/good @@ -20,6 +20,9 @@ gcc -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-s gcc -g -O3 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-d.c gcc -Wl,-z,relro -o test test-a.o test-b.o test-c.o -ltest +# -Wformat=2 implies -Wformat. +gcc -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat=2 -Werror=format-security -D_FORTIFY_SOURCE=2 -c test.c + # Compiling and linking in one step must also check CFLAGS/CPPFLAGS. gcc -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -Wl,-z,relro -o test test.c -ltest gcc -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -shared -fPIC -Wl,-z,relro -o test.so test.c -ltest -- 2.43.2