From fdaab39f4925720443a98f9d1b4695c3d554fece Mon Sep 17 00:00:00 2001 From: Jason Turner Date: Sat, 16 Sep 2017 09:06:01 -0600 Subject: [PATCH] Update warnings with info from Krister See also: https://kristerw.blogspot.se/2017/09/useful-gcc-warning-options-not-enabled.html --- 02-Use_the_Tools_Available.md | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/02-Use_the_Tools_Available.md b/02-Use_the_Tools_Available.md index 209b027..4270bbc 100644 --- a/02-Use_the_Tools_Available.md +++ b/02-Use_the_Tools_Available.md @@ -94,11 +94,18 @@ You should use as many compilers as you can for your platform(s). Each compiler * `-Wcast-align` warn for potential performance problem casts * `-Wunused` warn on anything being unused * `-Woverloaded-virtual` warn if you overload (not override) a virtual function - * `-pedantic` + * `-Wpedantic` warn if non-standard C++ is used * `-Wconversion` warn on type conversions that may lose data * `-Wsign-conversion` warn on sign conversions * `-Wmisleading-indentation` warn if identation implies blocks where blocks do not exist - + * `-Wduplicated-cond` warn if `if` / `else` chain has duplicated conditions + * `-Wduplicated-branches` warn if `if` / `else` branches have duplicated code + * `-Wlogical-op` warn about logical operations being used where bitwise were probably wanted + * `-Wnull-dereference` warn if a null dereference is detected + * `-Wuseless-cast` warn if you perform a cast to the same type + * `-Wdouble-promotion` warn if `float` is implicit promoted to `double` + * `-Wformat=2` warn on security issues around functions that format output (ie `printf`) + Consider using `-Weverything` and disabling the few warnings you need to on Clang