8000 Merge pull request #95 from ashutosh108/patch-1 · ankuPRK/cppbestpractices@0af98c3 · GitHub
[go: up one dir, main page]

Skip to content

Commit 0af98c3

Browse files
authored
Merge pull request cpp-best-practices#95 from ashutosh108/patch-1
add GCC/Clang compiler versions for warning flags
2 parents 4035ddb + f49737b commit 0af98c3

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

02-Use_the_Tools_Available.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -105,18 +105,18 @@ You should use as many compilers as you can for your platform(s). Each compiler
105105
* `-Wcast-align` warn for potential performance problem casts
106106
* `-Wunused` warn on anything being unused
107107
* `-Woverloaded-virtual` warn if you overload (not override) a virtual function
108-
* `-Wpedantic` warn if non-standard C++ is used
108+
* `-Wpedantic` (all versions of GCC, Clang >= 3.2) warn if non-standard C++ is used
109109
* `-Wconversion` warn on type conversions that may lose data
110-
* `-Wsign-conversion` warn on sign conversions
111-
* `-Wmisleading-indentation` warn if indentation implies blocks where blocks do not exist
112-
* `-Wduplicated-cond` warn if `if` / `else` chain has duplicated conditions
113-
* `-Wduplicated-branches` warn if `if` / `else` branches have duplicated code
114-
* `-Wlogical-op` warn about logical operations being used where bitwise were probably wanted
115-
* `-Wnull-dereference` warn if a null dereference is detected
116-
* `-Wuseless-cast` warn if you perform a cast to the same type
117-
* `-Wdouble-promotion` warn if `float` is implicit promoted to `double`
110+
* `-Wsign-conversion` (Clang all versions, GCC >= 4.3) warn on sign conversions
111+
* `-Wmisleading-indentation` (only in GCC >= 6.0) warn if indentation implies blocks where blocks do not exist
112+
* `-Wduplicated-cond` (only in GCC >= 6.0) warn if `if` / `else` chain has duplicated conditions
113+
* `-Wduplicated-branches` (only in GCC >= 7.0) warn if `if` / `else` branches have duplicated code
114+
* `-Wlogical-op` (only in GCC) warn about logical operations being used where bitwise were probably wanted
115+
* `-Wnull-dereference` (only in GCC >= 6.0) warn if a null dereference is detected
116+
* `-Wuseless-cast` (only in GCC >= 4.8) warn if you perform a cast to the same type
117+
* `-Wdouble-promotion` (GCC >= 4.6, Clang >= 3.8) warn if `float` is implicit promoted to `double`
118118
* `-Wformat=2` warn on security issues around functions that format output (ie `printf`)
119-
* `-Wlifetime` (clang only currently) shows object lifetime issues
119+
* `-Wlifetime` (only special branch of Clang currently) shows object lifetime issues
120120

121121
Consider using `-Weverything` and disabling the few warnings you need to on Clang
122122

0 commit comments

Comments
 (0)
0