@@ -7,150 +7,153 @@ if(TARGET ipc::toolkit::warnings)
7
7
return ()
8
8
endif ()
9
9
10
- set (IPC_TOOLKIT_WARNING_FLAGS
11
- -Wall
12
- -Wextra
13
- -Wpedantic
14
- # -Werror
15
-
16
- # -Wconversion
17
- -Werror=enum-conversion
18
- -Wfloat-conversion
19
- # Disable these errors for now, because they are too noisy
20
- # -Wno-sign-conversion
21
- # -Wno-shorten-64-to-32
22
- # -Wunsafe-loop-optimizations # broken with C++11 loops
23
- -Wunused
24
-
25
- -Wno-long-long # disable warnings about using long long
26
- -Wpointer-arith
27
- -Wformat=2
28
- -Wuninitialized
29
- -Wcast-qual
30
- -Wmissing-noreturn
31
- -Wmissing-format-attribute
32
- -Wredundant-decls
33
-
34
- -Werror=implicit
35
- -Werror=nonnull
36
- -Werror=init-self
37
- -Werror=main
38
- -Werror=missing-braces
39
- -Werror=sequence-point
40
- -Werror=return-type
41
- -Werror=trigraphs
42
- -Warray-bounds
43
- -Werror=write-strings
44
- -Werror=address
45
- -Werror=int-to-pointer-cast
46
- -Werror=pointer-to-int-cast
47
- -Werror=inconsistent-missing-override
48
- -Werror=return-stack-address
49
-
50
- -Wunused-variable
51
- -Wunused-but-set-variable
52
- -Wno-unused-parameter
53
-
54
- # -Weffc++
55
- -Wold-style-cast
56
-
57
- -Wshadow
58
-
59
- -Wstrict-null-sentinel
60
- -Woverloaded-virtual
61
- -Wsign-promo
62
- -Wstack-protector
63
- -Wstrict-aliasing
64
- -Wstrict-aliasing=2
65
-
66
- # Warn whenever a switch statement has an index of enumerated type and
67
- # lacks a case for one or more of the named codes of that enumeration.
68
- -Wswitch
69
- # This is annoying if all cases are already covered.
70
- -Wswitch-default
71
- # This is annoying if there is a default that covers the rest.
72
- # -Wswitch-enum
73
- -Wswitch-unreachable
74
- # -Wcovered-switch-default # Annoying warnings from nlohmann::json
75
-
76
- -Wcast-align
77
- -Wdisabled-optimization
78
- # -Winline # produces warning on default implicit destructor
79
- -Winvalid-pch
80
- -Wmissing-include-dirs
81
- -Wpacked
82
- -Wno-padded
83
- -Wstrict-overflow
84
- -Wstrict-overflow=2
85
-
86
- -Wctor-dtor-privacy
87
- -Wlogical-op
88
- -Woverloaded-virtual
89
- # -Wundef
90
-
91
- -Werror=non-virtual-dtor
92
- -Werror=delete-non-virtual-dtor
93
-
94
- -Wno-sign-compare
95
-
96
- ###########
97
- # GCC 6.1 #
98
- ###########
99
-
100
- -Wnull-dereference
101
- -fdelete-null-pointer-checks
102
- -Wduplicated-cond
103
- -Wmisleading-indentation
104
-
105
- #-Weverything
106
-
107
- ###########################
108
- # Enabled by -Weverything #
109
- ###########################
110
-
111
- #-Wdocumentation
112
- #-Wdocumentation-unknown-command
113
- #-Wfloat-equal
114
-
115
- #-Wglobal-constructors
116
- #-Wexit-time-destructors
117
- #-Wmissing-variable-declarations
118
- #-Wextra-semi
119
- #-Wweak-vtables
120
- #-Wno-source-uses-openmp
121
- #-Wdeprecated
122
- #-Wnewline-eof
123
- #-Wmissing-prototypes
124
-
125
- #-Wno-c++98-compat
126
- #-Wno-c++98-compat-pedantic
127
-
128
- ################################################
129
- # Need to check if those are still valid today #
130
- ################################################
131
-
132
- #-Wimplicit-atomic-properties
133
- #-Wmissing-declarations
134
- #-Wmissing-prototypes
135
- #-Wstrict-selector-match
136
- #-Wundeclared-selector
137
- #-Wunreachable-code
138
-
139
- # Not a warning, but enable link-time-optimization
140
- # TODO: Check out modern CMake version of setting this flag
141
- # https://cmake.org/cmake/help/latest/module/CheckIPOSupported.html
142
- #-flto
143
-
144
- # Gives meaningful stack traces
145
- -fno-omit-frame-pointer
146
- -fno-optimize-sibling-calls
147
-
148
- -Wno-redundant-decls
149
- )
150
-
151
10
# Flags above don't make sense for MSVC
152
11
if (MSVC )
153
- set (IPC_TOOLKIT_WARNING_FLAGS )
12
+ set (IPC_TOOLKIT_WARNING_FLAGS
13
+ /Wall # Display all warnings
14
+ /MP # Multi-processor compilation
15
+ )
16
+ else ()
17
+ set (IPC_TOOLKIT_WARNING_FLAGS
18
+ -Wall
19
+ -Wextra
20
+ -Wpedantic
21
+ # -Werror
22
+
23
+ # -Wconversion
24
+ -Werror=enum-conversion
25
+ -Wfloat-conversion
26
+ # Disable these errors for now, because they are too noisy
27
+ # -Wno-sign-conversion
28
+ # -Wno-shorten-64-to-32
29
+ # -Wunsafe-loop-optimizations # broken with C++11 loops
30
+ -Wunused
31
+
32
+ -Wno-long-long # disable warnings about using long long
33
+ -Wpointer-arith
34
+ -Wformat=2
35
+ -Wuninitialized
36
+ -Wcast-qual
37
+ -Wmissing-noreturn
38
+ -Wmissing-format-attribute
39
+ -Wredundant-decls
40
+
41
+ -Werror=implicit
42
+ -Werror=nonnull
43
+ -Werror=init-self
44
+ -Werror=main
45
+ -Werror=missing-braces
46
+ -Werror=sequence-point
47
+ -Werror=return-type
48
+ -Werror=trigraphs
49
+ -Warray-bounds
50
+ -Werror=write-strings
51
+ -Werror=address
52
+ -Werror=int-to-pointer-cast
53
+ -Werror=pointer-to-int-cast
54
+ -Werror=inconsistent-missing-override
55
+ -Werror=return-stack-address
56
+
57
+ -Wunused-variable
58
+ -Wunused-but-set-variable
59
+ -Wno-unused-parameter
60
+
61
+ # -Weffc++
62
+ -Wold-style-cast
63
+
64
+ -Wshadow
65
+
66
+ -Wstrict-null-sentinel
67
+ -Woverloaded-virtual
68
+ -Wsign-promo
69
+ -Wstack-protector
70
+ -Wstrict-aliasing
71
+ -Wstrict-aliasing=2
72
+
73
+ # Warn whenever a switch statement has an index of enumerated type and
74
+ # lacks a case for one or more of the named codes of that enumeration.
75
+ -Wswitch
76
+ # This is annoying if all cases are already covered.
77
+ -Wswitch-default
78
+ # This is annoying if there is a default that covers the rest.
79
+ # -Wswitch-enum
80
+ -Wswitch-unreachable
81
+ # -Wcovered-switch-default # Annoying warnings from nlohmann::json
82
+
83
+ -Wcast-align
84
+ -Wdisabled-optimization
85
+ # -Winline # produces warning on default implicit destructor
86
+ -Winvalid-pch
87
+ -Wmissing-include-dirs
88
+ -Wpacked
89
+ -Wno-padded
90
+ -Wstrict-overflow
91
+ -Wstrict-overflow=2
92
+
93
+ -Wctor-dtor-privacy
94
+ -Wlogical-op
95
+ -Woverloaded-virtual
96
+ # -Wundef
97
+
98
+ -Werror=non-virtual-dtor
99
+ -Werror=delete-non-virtual-dtor
100
+
101
+ -Wno-sign-compare
102
+
103
+ ###########
104
+ # GCC 6.1 #
105
+ ###########
106
+
107
+ -Wnull-dereference
108
+ -fdelete-null-pointer-checks
109
+ -Wduplicated-cond
110
+ -Wmisleading-indentation
111
+
112
+ #-Weverything
113
+
114
+ ###########################
115
+ # Enabled by -Weverything #
116
+ ###########################
117
+
118
+ #-Wdocumentation
119
+ #-Wdocumentation-unknown-command
120
+ #-Wfloat-equal
121
+
122
+ #-Wglobal-constructors
123
+ #-Wexit-time-destructors
124
+ #-Wmissing-variable-declarations
125
+ #-Wextra-semi
126
+ #-Wweak-vtables
127
+ #-Wno-source-uses-openmp
128
+ #-Wdeprecated
129
+ #-Wnewline-eof
130
+ #-Wmissing-prototypes
131
+
132
+ #-Wno-c++98-compat
133
+ #-Wno-c++98-compat-pedantic
134
+
135
+ ################################################
136
+ # Need to check if those are still valid today #
137
+ ################################################
138
+
139
+ #-Wimplicit-atomic-properties
140
+ #-Wmissing-declarations
141
+ #-Wmissing-prototypes
142
+ #-Wstrict-selector-match
143
+ #-Wundeclared-selector
144
+ #-Wunreachable-code
145
+
146
+ # Not a warning, but enable link-time-optimization
147
+ # TODO: Check out modern CMake version of setting this flag
148
+ # https://cmake.org/cmake/help/latest/module/CheckIPOSupported.html
149
+ #-flto
150
+
151
+ # Gives meaningful stack traces
152
+ -fno-omit-frame-pointer
153
+ -fno-optimize-sibling-calls
154
+
155
+ -Wno-redundant-decls
156
+ )
154
157
endif ()
155
158
156
159
add_library (ipc_toolkit_warnings INTERFACE )
0 commit comments