Skip to content

Commit e4c121c

Browse files
authored
Move -Wuseless-cast from STRICT to ALL CXX warnings (#27)
`-Wuseless-cast` conflicts with defensive casting practices required in MISRA C++ guidelines. For example, casts between domain-specific aliases that resolve to the same underlying type are flagged by the compiler, despite documenting semantic type boundaries and guarding against future type changes.
1 parent b3e4f9f commit e4c121c

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

templates/linux/cc_toolchain_flags.bzl.template

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,6 @@ STRICT_C_WARNINGS_FLAGS = get_flag_group([
148148

149149
STRICT_CXX_WARNINGS_FLAGS = get_flag_group([
150150
"-Wnarrowing",
151-
"-Wuseless-cast",
152151
])
153152

154153
# -----------------------------------------------------------------------------
@@ -180,6 +179,7 @@ ALL_WALL_CXX_WARNINGS = get_flag_group([
180179
"-Wpessimizing-move",
181180
"-Wrange-loop-construct",
182181
# "-Wself-move", not supported in GCC12.2
182+
"-Wuseless-cast",
183183
])
184184

185185
ALL_WALL_WARNINGS = get_flag_group([

0 commit comments

Comments
 (0)