summaryrefslogtreecommitdiff
path: root/cmake/warnings.cmake
blob: cd3cdf9d970a7356db770d9175dab9fad94cf2ac (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
set(FUD_WARNINGS
    # baseline
    -Werror
    -Wall
    -Wextra
    -pedantic
    -pedantic-errors
    -Wstack-usage=2048 # GCC specific
    -Wvla # variable modified types don't play nice in C++
    # types
    -Wlong-long
    -Wlong-long
    -Winline
    # memory / data /  array / string
    -Wsizeof-pointer-memaccess
    -Wpacked
    -Wuninitialized
    -Wstack-protector
    -Warray-bounds
    -Woverlength-strings
    -Wwrite-strings
    -Wcast-align
    -Wchar-subscripts
    -Wpointer-arith
    -Wstrict-aliasing
    -Wstrict-aliasing=2
    -Wstrict-null-sentinel
    # classes / initialization
    -Weffc++
    -Wmismatched-tags
    -Wmissing-field-initializers
    -Winit-self
    -Wctor-dtor-privacy
    -Wnon-virtual-dtor
    -Wsuggest-final-types
    -Wsuggest-final-methods
    -Wsuggest-override
    # format
    -Wformat
    -Wformat=2
    -Wformat-nonliteral
    -Wformat-security
    -Wformat-y2k
    -Wmissing-format-attribute
    -Wformat-overflow
    -Wformat-security
    -Wformat-signedness
    # floats and signedness
    -Wfloat-equal
    -Wsign-compare
    -Wsign-conversion
    -Wdouble-promotion
    # semantics / style
    -Wshadow
    -Wnull-dereference
    -Wimplicit-fallthrough=5
    -Wduplicated-branches
    -Wduplicated-cond
    -Wcast-qual
    -Wcomment
    -Wconversion
    -Wmissing-braces
    -Winvalid-pch
    -Wmissing-include-dirs
    -Wparentheses
    -Wredundant-decls
    -Wreturn-type
    -Wsequence-point
    -Wtrigraphs
    -Wunknown-pragmas
    -Wunused
    -Wunused-function
    -Wunused-label
    -Wunused-parameter
    -Wunused-value
    -Wunused-variable
    -Wswitch
    -Wswitch-default
    -Wswitch-enum
    # this plays badly with clangd
    # -Wzero-as-null-pointer-constant
    -Wlogical-op
    -Wuseless-cast
    -Wextra-semi
    -Wredundant-decls
    -Wmisleading-indentation
    # optmizations
    -Wdisabled-optimization
    -Wmissing-noreturn
    -Wvariadic-macros
    -Wvolatile-register-var
    -Wunreachable-code
)