c++ warning correspondence table (Clang/GCC and Visual Studio)
- Clang
- GCC
- MSVC
GCC Group | GCC Warn | Clang Group | Clang Warn | VC Group | VC Warn |
---|---|---|---|---|---|
warning | -Wmacro-redefined | /W1 | C4005 | ||
-Wcomment | -Wcomment | /W1 | C4010 | ||
-Wsign-compare | -Wsign-compare | /W3 | C4018, C4287 | ||
-Wsign-compare | -Wsign-compare | /W4 | C4388, C4389 | ||
-Wextra-semi-stmt | /W4 | C4019 | |||
- | -Wswitch-enum | - | -Wswitch-enum | /W4 | C4061 |
-Wswitch | -Wswitch | /W4 | C4062 | ||
-Wswitch | -Wswitch | C4063 | |||
-Wendif-labels | -Wextra-tokens | /W1 | C4067 | ||
-Wunknown-pragmas | -Wunknown-pragmas | /W1 | C4068 | ||
-Wmismatched-tags | /W2 | C4099 | |||
-Wunused-parameter | -Wunused-parameter | /W4 | C4100 | ||
-Wunused-variable | -Wunused-variable | /W3 | C4101 | ||
-Wunused-variable | -Wunused-variable | /W4 | C4189 | ||
-Wunused-label | -Wunused-label | /W3 | C4102 | ||
-Wpragma-pack | /W1 | C4103 | |||
-pedantic | warning | -pedantic | -Wgnu-zero-line-directive | /W1,4 | C4112 |
-Wduplicate-decl-specifier | /W1 | C4114, C4141 | |||
-Wbuiltin-macro-redefined | -Wbuiltin-macro-redefined | /W1 | C4117 | ||
warning | -Wunknown-escape-sequence | /W1 | C4129 | ||
-Waddress | -Wstring-compare | /W4 | C4130 | ||
-Wswitch-bool | /W1 | C4144, C4145 | |||
-Wdelete-incomplete | -Wdelete-incomplete | /W2 | C4150 | ||
-Wreturn-local-addr | -Wreturn-stack-address | /W1 | C4172 | ||
-Wnarrowing | error | -Wc++11-narrowing | /W1 | C4178, C4838 | |
-Wignored-qualifiers | /W1 | C4180 | |||
-Wignored-qualifiers | /W3 | C4197 | |||
-Wreturn-type-c-linkage | /W1 | C4190 | |||
-pedantic | -Wpedantic | -pedantic | -Wzero-length-array | /W2,4 | C4200 |
-pedantic | -Wpedantic | -pedantic | -Wgnu-anonymous-struct | /W4 | C4201 |
- | -Wconversion | - | -Wimplicit-int-conversion | /W4 | C4242 |
- | -Wfloat-conversion | - | -Wfloat-conversion | /W2 | C4244 |
- | -Wconversion | - | -Wconversion | /W3,4 | C4244 |
- | -Wsign-conversion | - | -Wsign-conversion | /W2 | C4308 |
- | -Wsign-conversion | - | -Wsign-conversion | /W4 | C4245, C4365 |
- | -Woverloaded-virtual | -Woverloaded-virtual | /W4 | C4263 | |
- | -Wnon-virtual-dtor | - | -Wnon-virtual-dtor | /W3 | C4265 |
- | -Wnon-virtual-dtor | - | -Wnon-virtual-dtor | C5204 | |
- | -Wconversion | - | -Wshorten-64-to-32 | /W3 | C4267 |
warning | -Wexceptions | /W1 | C4286 | ||
-Wshift-count-overflow | -Wshift-count-overflow | /W1 | C4293 | ||
-Wtype-limits | -Wtautological-unsigned-zero-compare | /W4 | C4296 | ||
- | -Wold-style-cast | - | -Wold-style-cast | C4303 | |
- | -Wfloat-conversion | - | -Wimplicit-float-conversion | /W1 | C4305 |
-Woverflow | -Winteger-overflow | /W2 | C4307 | ||
- | -Wconversion | -Wconstant-conversion | /W2 | C4309 | |
-Wint-to-void-pointer-cast | -Wint-to-void-pointer-cast | /W1 | C4312 | ||
-Wformat | -Wformat | /W1 | C4313, C4473, C4477 | ||
-Wformat | -Wformat | /W3 | C4475, C4476 | ||
-Wformat-extra-args | -Wformat-extra-args | /W1 | C4317 | ||
-Wformat-extra-args | -Wformat-extra-args | /W3 | C4474 | ||
-Wmemset-transposed-args | -Wmemset-transposed-args | C4318 | |||
-Wempty-body | -Wempty-body | /W3 | C4390 | ||
warning | -Wmissing-declarations | /W4 | C4408 | ||
error | -Wunicode | /W4 | C4429 | ||
- | -Wshadow | - | -Wshadow | /W4 | C4456, C4457, C4458, C4459 |
- | -Wshadow | - | -Wshadow-field-in-constructor | ||
-Wbitfield-constant-conversion | /W4 | C4463 | |||
-Waddress | -Wcomma | /W1 | C4545, C4546 | ||
-Wcomma | /W4 | C4913 | |||
-Wtautological-compare | -Wunused-comparison | /W1 | C4547 | ||
-Wunused-value | -Wunused-comparison | /W1 | C4549, C4553 | ||
-Wunused-value | -Wunused-value | /W1 | C4548, C4552, C4555 | ||
-Wunused-value (-Waddress) | -Wunused-value | /W1 | C4551 | ||
-Wparentheses | -Wshift-op-parentheses | /W3 | C4554 | ||
-Wmultichar | error | /W1 | C4566 | ||
-Winaccessible-base | -Winaccessible-base | /W1 | C4584 | ||
- | -Wundef | - | -Wundef | /W4 | C4668 |
-Wuninitialized | -Wuninitialized | /W1,4 | C4700 | ||
-Wsometimes-uninitialized | /W4 | C4701, C4703 | |||
- | -Wunreachable-code | - | -Wunreachable-code | /W1 | C4288 |
- | -Wunreachable-code | - | -Wunreachable-code | /W4 | C4702 |
-Wparentheses | -Wparentheses | /W4 | C4706 | ||
-Wcomma-subscript | -Wdeprecated-comma-subscript | /W4 | C4709 | ||
-Wreturn-type | -Wreturn-type | /W1 | C4715, C4716 | ||
-Winfinite-recursion | /W1 | C4717 | |||
-Wdiv-by-zero | -Wdivision-by-zero | /W3 | C4723, C4274 | ||
-Wcast-align | /W1 | C4739 | |||
-Wfortify-source | /W1 | C4789 | |||
-Wbool-compare | -Wtautological-constant-out-of-range-compare | /W1 | C4806 | ||
-Wswitch-outside-range | (-Wswitch-bool) | /W1 | C4808 | ||
-Wvexing-parse | /W1 | C4930 | |||
-Wreinterpret-base-class | /W1 | C4946 | |||
-Wdeprecated | -Wdeprecated | /W1 | C4973, C4974 | ||
warning | -Wc++17-extensions | C4984 | |||
-Wdeprecated-declarations | -Wdeprecated-declarations | /W3 | C4996 | ||
-Wreorder | -Wreorder-ctor | C5038 | |||
-Wexpansion-to-defined | -Wexpansion-to-defined | /W1 | C5105 | ||
- | -Wimplicit-int-float-conversion | /Wall | C5219 | ||
-Wabsolute-value | |||||
-Wabstract-final-class | |||||
error | - | -Wambiguous-reversed-operator | |||
- | -Wcovered-switch-default | ||||
- | -Wdouble-promotion | - | -Wdouble-promotion | ||
- | -Wexit-time-destructors | ||||
- | -Wglobal-constructors | ||||
- | -Wgnu-zero-variadic-macro-arguments | ||||
- | -Winconsistent-missing-destructor-override | ||||
-Winconsistent-missing-override | |||||
-Wdangling-else | -Wdangling-else | ||||
-Wdangling-gsl | |||||
-Wmissing-braces | |||||
- | -Wmissing-noreturn | - | -Wmissing-noreturn | ||
- | -Wnull-arithmetic | ||||
-Wconversion-null | -Wnull-conversion | ||||
-Wparentheses-equality | |||||
- | -Wsuggest-attribute=noreturn | (-Wmissing-noreturn) | |||
- | -Wshadow-compatible-local | -Wshadow-all | -Wshadow-uncaptured-local | ||
- | -Wsuggest-destructor-override | ||||
- | -Wsuggest-override | - | -Wsuggest-override | ||
- | -Wzero-as-null-pointer-constant |