Enable strict-aliasing and implicit-fallthrough warnings

GCC needs to have the comment *right before* the case label... blergh
This commit is contained in:
Fabian Homborg 2021-01-29 18:16:00 +01:00
parent 4e8c0f757d
commit 005d3a5981
2 changed files with 3 additions and 4 deletions

View File

@ -39,6 +39,7 @@ if (CMAKE_GENERATOR STREQUAL "Ninja" AND
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fdiagnostics-color=always")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fdiagnostics-color=always")
endif()
# Enable a whole bunch of warnings, but turn off:
# - implicit fallthrough because that does not recognize some cases where it's desired (and I *really* want this one!)
# - comment because we use a bunch of those, and they're not really all that harmful.
@ -46,10 +47,8 @@ endif()
# - strict-aliasing, because on old GCCs (*Travis*) those are triggered by maybe.h, so you get it every time it is included.
# - redundant-move, because we have one that is required on old libc
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra \
-Wno-implicit-fallthrough \
-Wno-comment \
-Wno-address \
-Wno-strict-aliasing \
")
# Disable exception handling.

View File

@ -2941,9 +2941,9 @@ void reader_data_t::handle_readline_command(readline_cmd_t c, readline_loop_stat
parser().libdata().is_repaint = false;
break;
}
// Else we repaint as normal.
/* fallthrough */
// Else we repaint as normal
}
/* fallthrough */
case rl::force_repaint:
case rl::repaint: {
parser().libdata().is_repaint = true;