From 0d37a2bd61d6b619a95bc3e0437f163048009a29 Mon Sep 17 00:00:00 2001 From: Connor Olding Date: Thu, 5 Oct 2017 12:08:08 +0000 Subject: [PATCH] experimenting with more warnings --- home/-shrc | 13 ++++++++++++- sh/compile | 5 +++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/home/-shrc b/home/-shrc index f4ef28a..b58ba0e 100644 --- a/home/-shrc +++ b/home/-shrc @@ -98,17 +98,28 @@ whoa=( -Werror=pointer-to-int-cast -Werror=int-to-pointer-cast -Werror=return-type + -Werror=memset-transposed-args # -Werror=tautological-constant-out-of-range-compare # gcc doesn't like this # -Werror=undef -Wno-unused -Wno-padded -Wno-missing-field-initializers -# -Wno-type-limits +# -Wno-type-limits # bad for generated code (macros, templates) -Wno-misleading-indentation # gcc 6 -Wno-disabled-macro-expansion # clang -Wno-language-extension-token # clang -Wno-unknown-warning-option # clang + + # trying some stuff: + -Wduplicated-cond # gcc 6 + -Wduplicated-branches # gcc 7 + -Wlogical-op + -Wrestrict # gcc 7 + -Wnull-dereference # gcc 6 + -Wjump-misses-init + -Wdouble-promotion + -Wformat=2 ) welp=( diff --git a/sh/compile b/sh/compile index 5c003f2..0a74c63 100755 --- a/sh/compile +++ b/sh/compile @@ -217,6 +217,11 @@ compile() { elif [[ $flag == -W* ]] && [[ $flag != -Wl* ]]; then warnings+=($flag) + if [ $sepples -eq 0 ] && [[ $flag == -Wextra ]] then + # enable some warnings just for C. too annoying in C++. + warnings+=(-Wshadow -Winline) + fi + if [ $CC = cl ] && [ $flag = -Wall ]; then # disable some obnoxious msvc warnings. warnings+=(