-
Notifications
You must be signed in to change notification settings - Fork 0
debug.h ~ diagnostics
Baptiste Thémine edited this page Jun 9, 2020
·
3 revisions
#pragma GCC diagnostic warning /* implementation defined */
Executes pragma directives to enable a set of compiler diagnostics. These diagnostics cannot be overriden by compiler commmand line arguments.
The macro DEBUG
must be defined to enable the diagnostics.
-Wall
-Wextra
-Waddress
-Walloc-size-larger-than=PTRDIFF_MAX
-Walloc-zero
-Warray-bounds=2
-Wattribute-alias
-Wbool-compare
-Wbool-operation
-Wbuiltin-declaration-mismatch
-Wbuiltin-macro-redefined
-Wc++11-compat
-Wc++14-compat
-Wc++17-compat
-Wc++20-compat
-Wcast-align
-Wcast-align=strict
-Wcast-function-type
-Wcast-qual
-Wcatch-value=3
-Wchar-subscripts
-Wchkp
-Wclass-conversion
-Wclass-memaccess
-Wclobbered
-Wcomment
-Wconditionally-supported
-Wconversion
-Wconversion-null
-Wcpp
-Wctor-dtor-privacy
-Wdangling-else
-Wdate-time
-Wdelete-incomplete
-Wdelete-non-virtual-dtor
-Wdeprecated
-Wdeprecated-copy
-Wdeprecated-copy-dtor
-Wdeprecated-declarations
-Wdiv-by-zero
-Wdouble-promotion
-Wduplicated-branches
-Wduplicated-cond
-Wempty-body
-Wendif-labels
-Wenum-compare
-Wexpansion-to-defined
-Wextra-semi
-Wfloat-conversion
-Wformat-contains-nul
-Wformat-extra-args
-Wformat-nonliteral
-Wformat-overflow=2
-Wformat-security
-Wformat-signedness
-Wformat-truncation=2
-Wformat-y2k
-Wformat-zero-length
-Wformat=2
-Wframe-address
-Wignored-attributes
-Wignored-qualifiers
-Wimplicit-fallthrough
-Winherited-variadic-ctor
-Winit-list-lifetime
-Winit-self
-Winline
-Wint-in-bool-context
-Wint-to-pointer-cast
-Winvalid-offsetof
-Winvalid-pch
-Wlogical-not-parentheses
-Wlogical-op
-Wlto-type-mismatch
-Wmain
-Wmaybe-uninitialized
-Wmemset-elt-size
-Wmemset-transposed-args
-Wmisleading-indentation
-Wmissing-attributes
-Wmissing-braces
-Wmissing-declarations
-Wmissing-field-initializers
-Wmissing-include-dirs
-Wmultichar
-Wmultistatement-macros
-Wnarrowing
-Wnoexcept
-Wnoexcept-type
-Wnon-template-friend
-Wnon-virtual-dtor
-Wnonnull
-Wnonnull-compare
-Wnormalized=nfc
-Wnull-dereference
-Wopenmp-simd
-Woverloaded-virtual
-Wpessimizing-move
-Wplacement-new=2
-Wpmf-conversions
-Wpointer-arith
-Wpointer-compare
-Wpragmas
-Wredundant-decls
-Wredundant-move
-Wregister
-Wreorder
-Wrestrict
-Wreturn-type
-Wscalar-storage-order
-Wsequence-point
-Wshadow=compatible-local
-Wshift-count-negative
-Wshift-count-overflow
-Wshift-negative-value
-Wshift-overflow=2
-Wsign-compare
-Wsign-conversion
-Wsized-deallocation
-Wsizeof-array-argument
-Wsizeof-pointer-div
-Wsizeof-pointer-memaccess
-Wstrict-aliasing
-Wstrict-null-sentinel
-Wstrict-overflow=5
-Wstringop-overflow=4
-Wstringop-truncation
-Wsubobject-linkage
-Wsuggest-attribute=const
-Wsuggest-attribute=format
-Wsuggest-attribute=noreturn
-Wsuggest-attribute=pure
-Wsuggest-final-methods
-Wsuggest-final-types
-Wsuggest-override
-Wswitch
-Wswitch-bool
-Wswitch-default
-Wswitch-unreachable
-Wsync-nand
-Wsystem-headers
-Wtautological-compare
-Wterminate
-Wtrampolines
-Wtrigraphs
-Wtype-limits
-Wundef
-Wuninitialized
-Wunknown-pragmas
-Wunreachable-code
-Wunsafe-loop-optimizations
-Wunused
-Wunused-but-set-parameter
-Wunused-but-set-variable
-Wunused-const-variable=2
-Wunused-function
-Wunused-label
-Wunused-local-typedefs
-Wunused-macros
-Wunused-parameter
-Wunused-result
-Wunused-value
-Wunused-variable
-Wuseless-cast
-Wvarargs
-Wvirtual-move-assign
-Wvla
-Wvolatile-register-var
-Wwrite-strings
-Wzero-as-null-pointer-constant
-Weffc++
-Wfloat-equal
-Wliteral-suffix
-Wlong-long
-Wmultiple-inheritance
-Wnamespaces
-Wold-style-cast
-Woverlength-strings
-Wparentheses
-Wpedantic
-Wsign-promo
-Wswitch-enum
-Wtemplates
-Wvariadic-macros
-Wvirtual-inheritance
//debug diagnostics enabled
g++ -c test.cpp -DDEBUG
clang++ -c test.cpp -DDEBUG
//debug diagnostics disabled --> command line arguments can be used
g++ -c test.cpp -Wall -Wextra -Wno-parentheses
clang++ -c test.cpp -Wall -Wextra -Wno-parentheses