From fc370b3feb419fdc1a8139bdf01f1dacf868ca1f Mon Sep 17 00:00:00 2001 From: Rémi Verschelde Date: Fri, 5 Apr 2019 14:06:16 +0200 Subject: Fix -Wimplicit-fallthrough warnings from GCC 8 Adds `FALLTHROUGH` macro to specify when a fallthrough is intentional. Can be replaced by `[[fallthrough]]` if/when we switch to C++17. The warning is now enabled by default for GCC on `extra` warnings level (part of GCC's `-Wextra`). It's not enabled in Clang's `-Wextra` yet, but we could enable it manually once we switch to C++11. There's no equivalent feature in MSVC for now. Fixes #26135. --- editor/editor_node.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'editor/editor_node.cpp') diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index 2f03a9943f..6c629c1869 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -1900,7 +1900,8 @@ void EditorNode::_menu_option_confirm(int p_option, bool p_confirmed) { break; } - } // fallthrough + FALLTHROUGH; + } case SCENE_TAB_CLOSE: case FILE_SAVE_SCENE: { @@ -1919,8 +1920,8 @@ void EditorNode::_menu_option_confirm(int p_option, bool p_confirmed) { break; } - // fallthrough to save_as - }; + FALLTHROUGH; + } case FILE_SAVE_AS_SCENE: { int scene_idx = (p_option == FILE_SAVE_SCENE || p_option == FILE_SAVE_AS_SCENE) ? -1 : tab_closing; -- cgit v1.2.3