From 1275d9614724308b97724dacb7713f07fdb173d0 Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Thu, 12 May 2016 08:39:58 +0300 Subject: -Werror,-Wimplicit-fallthrough Fix "fallthrough annotation in unreachable code". Clang is clever enough to know that code after assert(false) is unreachable in a non-NDEBUG build. Seriously, micro-optimisation of the case that should never be reached? Change-Id: I10d7ae60895437be52c27aa93539d17e0f091ac4 --- sal/osl/all/log.cxx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'sal') diff --git a/sal/osl/all/log.cxx b/sal/osl/all/log.cxx index d122bbc0a032..9c75393bd327 100644 --- a/sal/osl/all/log.cxx +++ b/sal/osl/all/log.cxx @@ -63,9 +63,6 @@ bool equalStrings( #if !defined ANDROID char const * toString(sal_detail_LogLevel level) { switch (level) { - default: - assert(false); // this cannot happen - SAL_FALLTHROUGH; case SAL_DETAIL_LOG_LEVEL_INFO: return "info"; case SAL_DETAIL_LOG_LEVEL_WARN: @@ -73,6 +70,9 @@ char const * toString(sal_detail_LogLevel level) { case SAL_DETAIL_LOG_LEVEL_DEBUG: case SAL_DETAIL_LOG_LEVEL_DEBUG_TRACE: return "debug"; + default: + assert(false); // this cannot happen + return "broken"; } } #endif @@ -244,9 +244,6 @@ void log( case SAL_DETAIL_LOG_LEVEL_INFO: prio = LOG_INFO; break; - default: - assert(false); // this cannot happen - SAL_FALLTHROUGH; case SAL_DETAIL_LOG_LEVEL_WARN: prio = LOG_WARNING; break; @@ -254,6 +251,9 @@ void log( case SAL_DETAIL_LOG_LEVEL_DEBUG_TRACE: prio = LOG_DEBUG; break; + default: + assert(false); // this cannot happen + prio = LOG_WARNING; } syslog(prio, "%s", s.str().c_str()); #endif -- cgit