CMake: prefer normal C++17 [[fallthrough]] annotation

This commit is contained in:
Adriaan de Groot 2020-10-24 17:20:23 +02:00
parent 364d50679f
commit 9a2fca7f5b
4 changed files with 7 additions and 7 deletions

View File

@ -228,7 +228,7 @@ if( CMAKE_CXX_COMPILER_ID MATCHES "Clang" )
)
string( APPEND CMAKE_CXX_FLAGS " ${CLANG_WARNINGS}" )
endforeach()
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DNOTREACHED='//' -DFALLTHRU='[[clang::fallthrough]]'")
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DNOTREACHED='//'")
# Third-party code where we don't care so much about compiler warnings
# (because it's uncomfortable to patch) get different flags; use
@ -247,7 +247,7 @@ else()
set( SUPPRESS_3RDPARTY_WARNINGS "" )
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DNOTREACHED='__builtin_unreachable();' -DFALLTHRU='/* */'" )
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DNOTREACHED='__builtin_unreachable();'" )
endif()
# Use mark_thirdparty_code() to reduce warnings from the compiler

View File

@ -42,7 +42,7 @@ makeSlideshow( QWidget* parent )
return new Calamares::SlideshowPictures( parent );
#ifdef WITH_QML
case 1:
FALLTHRU;
[[fallthrough]];
case 2:
return new Calamares::SlideshowQML( parent );
#endif

View File

@ -33,12 +33,12 @@ PackageChooserPage::PackageChooserPage( PackageChooserMode mode, QWidget* parent
switch ( mode )
{
case PackageChooserMode::Optional:
FALLTHRU;
[[fallthrough]];
case PackageChooserMode::Required:
ui->products->setSelectionMode( QAbstractItemView::SingleSelection );
break;
case PackageChooserMode::OptionalMultiple:
FALLTHRU;
[[fallthrough]];
case PackageChooserMode::RequiredMultiple:
ui->products->setSelectionMode( QAbstractItemView::ExtendedSelection );
}

View File

@ -182,10 +182,10 @@ enableLevelsBelow( Config* config, TrackingType level )
{
case TrackingType::UserTracking:
config->userTracking()->setTracking( TrackingStyleConfig::TrackingState::EnabledByUser );
FALLTHRU;
[[fallthrough]];
case TrackingType::MachineTracking:
config->machineTracking()->setTracking( TrackingStyleConfig::TrackingState::EnabledByUser );
FALLTHRU;
[[fallthrough]];
case TrackingType::InstallTracking:
config->installTracking()->setTracking( TrackingStyleConfig::TrackingState::EnabledByUser );
break;