Skip to content

Commit 4db2bea

Browse files
schuermans-rooflinepstarkcdpr
authored andcommitted
[build flags] enable more warnings in compile flags (iree-org#22240)
Enable more warnings during compilation by removing some of of the -Wno-* compile flags: ``` -Wno-ambiguous-member-template -Wno-char-subscripts -Wno-gnu-alignof-expression -Wno-gnu-variable-sized-type-not-at-end -Wno-ignored-optimization-argument -Wno-invalid-source-encoding -Wno-mismatched-tags -Wno-missing-braces -Wno-pointer-sign -Wno-reserved-user-defined-literal -Wno-return-type-c-linkage -Wno-self-assign-overloaded -Wno-sign-compare -Wno-signed-unsigned-wchar -Wno-strict-overflow -Wno-trigraphs -Wno-unknown-pragmas -Wno-unknown-warning-option -Wno-unused-command-line-argument -Wno-unused-local-typedef -Wno-user-defined-warnings ``` The -Wno-* flags used by bazel had been slightly different from the ones used by cmake. This change re-aligns this. A few code locations have been adapted to compile with the additional warnings enabled. Signed-off-by: Stefan Schuermans <[email protected]>
1 parent 56b149d commit 4db2bea

File tree

2 files changed

+0
-40
lines changed

2 files changed

+0
-40
lines changed

build_tools/bazel/iree.bazelrc

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -106,30 +106,11 @@ build:generic_clang --copt=-Wall
106106
# Disable warnings we don't care about or that generally have a low signal/noise
107107
# ratio.
108108
build:generic_clang --copt=-Wno-ambiguous-member-template
109-
build:generic_clang --copt=-Wno-char-subscripts
110109
build:generic_clang --copt=-Wno-extern-c-compat # Matches upstream. Cannot impact due to extern C inclusion method.
111-
build:generic_clang --copt=-Wno-gnu-alignof-expression
112-
build:generic_clang --copt=-Wno-gnu-variable-sized-type-not-at-end
113-
build:generic_clang --copt=-Wno-ignored-optimization-argument
114110
build:generic_clang --copt=-Wno-invalid-offsetof # Technically UB but needed for intrusive ptrs
115-
build:generic_clang --copt=-Wno-invalid-source-encoding
116-
build:generic_clang --copt=-Wno-mismatched-tags
117-
build:generic_clang --copt=-Wno-pointer-sign
118-
build:generic_clang --copt=-Wno-reserved-user-defined-literal
119-
build:generic_clang --copt=-Wno-return-type-c-linkage
120-
build:generic_clang --copt=-Wno-self-assign-overloaded
121-
build:generic_clang --copt=-Wno-sign-compare
122-
build:generic_clang --copt=-Wno-signed-unsigned-wchar
123-
build:generic_clang --copt=-Wno-strict-overflow
124-
build:generic_clang --copt=-Wno-trigraphs
125-
build:generic_clang --copt=-Wno-unknown-pragmas
126-
build:generic_clang --copt=-Wno-unknown-warning-option
127-
build:generic_clang --copt=-Wno-unused-command-line-argument
128111
build:generic_clang --copt=-Wno-unused-const-variable
129112
build:generic_clang --copt=-Wno-unused-function
130-
build:generic_clang --copt=-Wno-unused-local-typedef
131113
build:generic_clang --copt=-Wno-unused-private-field
132-
build:generic_clang --copt=-Wno-user-defined-warnings
133114

134115
# Explicitly enable some additional warnings.
135116
# Some of these aren't on by default, or under -Wall, or are subsets of warnings

build_tools/cmake/iree_copts.cmake

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -169,32 +169,11 @@ iree_select_compiler_opts(IREE_DEFAULT_COPTS
169169

170170
# Disable warnings we don't care about or that generally have a low
171171
# signal/noise ratio.
172-
"-Wno-ambiguous-member-template"
173-
"-Wno-char-subscripts"
174172
"-Wno-extern-c-compat" # Matches upstream. Cannot impact due to extern C inclusion method.
175-
"-Wno-gnu-alignof-expression"
176-
"-Wno-gnu-variable-sized-type-not-at-end"
177-
"-Wno-ignored-optimization-argument"
178173
"-Wno-invalid-offsetof" # Technically UB but needed for intrusive ptrs
179-
"-Wno-invalid-source-encoding"
180-
"-Wno-mismatched-tags"
181-
"-Wno-pointer-sign"
182-
"-Wno-reserved-user-defined-literal"
183-
"-Wno-return-type-c-linkage"
184-
"-Wno-self-assign-overloaded"
185-
"-Wno-sign-compare"
186-
"-Wno-signed-unsigned-wchar"
187-
"-Wno-strict-overflow"
188-
"-Wno-trigraphs"
189-
"-Wno-unknown-pragmas"
190-
"-Wno-unknown-warning-option"
191-
"-Wno-unused-command-line-argument"
192174
"-Wno-unused-const-variable"
193175
"-Wno-unused-function"
194-
"-Wno-unused-local-typedef"
195176
"-Wno-unused-private-field"
196-
"-Wno-user-defined-warnings"
197-
"-Wno-missing-braces" # Inconsistently triggers between C++/C headers.
198177

199178
# Explicitly enable some additional warnings.
200179
# Some of these aren't on by default, or under -Wall, or are subsets of

0 commit comments

Comments
 (0)