CMake: prefer normal C++17 [[fallthrough]] annotation
This commit is contained in:
parent
364d50679f
commit
9a2fca7f5b
@ -228,7 +228,7 @@ if( CMAKE_CXX_COMPILER_ID MATCHES "Clang" )
|
|||||||
)
|
)
|
||||||
string( APPEND CMAKE_CXX_FLAGS " ${CLANG_WARNINGS}" )
|
string( APPEND CMAKE_CXX_FLAGS " ${CLANG_WARNINGS}" )
|
||||||
endforeach()
|
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
|
# Third-party code where we don't care so much about compiler warnings
|
||||||
# (because it's uncomfortable to patch) get different flags; use
|
# (because it's uncomfortable to patch) get different flags; use
|
||||||
@ -247,7 +247,7 @@ else()
|
|||||||
|
|
||||||
set( SUPPRESS_3RDPARTY_WARNINGS "" )
|
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()
|
endif()
|
||||||
|
|
||||||
# Use mark_thirdparty_code() to reduce warnings from the compiler
|
# Use mark_thirdparty_code() to reduce warnings from the compiler
|
||||||
|
@ -42,7 +42,7 @@ makeSlideshow( QWidget* parent )
|
|||||||
return new Calamares::SlideshowPictures( parent );
|
return new Calamares::SlideshowPictures( parent );
|
||||||
#ifdef WITH_QML
|
#ifdef WITH_QML
|
||||||
case 1:
|
case 1:
|
||||||
FALLTHRU;
|
[[fallthrough]];
|
||||||
case 2:
|
case 2:
|
||||||
return new Calamares::SlideshowQML( parent );
|
return new Calamares::SlideshowQML( parent );
|
||||||
#endif
|
#endif
|
||||||
|
@ -33,12 +33,12 @@ PackageChooserPage::PackageChooserPage( PackageChooserMode mode, QWidget* parent
|
|||||||
switch ( mode )
|
switch ( mode )
|
||||||
{
|
{
|
||||||
case PackageChooserMode::Optional:
|
case PackageChooserMode::Optional:
|
||||||
FALLTHRU;
|
[[fallthrough]];
|
||||||
case PackageChooserMode::Required:
|
case PackageChooserMode::Required:
|
||||||
ui->products->setSelectionMode( QAbstractItemView::SingleSelection );
|
ui->products->setSelectionMode( QAbstractItemView::SingleSelection );
|
||||||
break;
|
break;
|
||||||
case PackageChooserMode::OptionalMultiple:
|
case PackageChooserMode::OptionalMultiple:
|
||||||
FALLTHRU;
|
[[fallthrough]];
|
||||||
case PackageChooserMode::RequiredMultiple:
|
case PackageChooserMode::RequiredMultiple:
|
||||||
ui->products->setSelectionMode( QAbstractItemView::ExtendedSelection );
|
ui->products->setSelectionMode( QAbstractItemView::ExtendedSelection );
|
||||||
}
|
}
|
||||||
|
@ -182,10 +182,10 @@ enableLevelsBelow( Config* config, TrackingType level )
|
|||||||
{
|
{
|
||||||
case TrackingType::UserTracking:
|
case TrackingType::UserTracking:
|
||||||
config->userTracking()->setTracking( TrackingStyleConfig::TrackingState::EnabledByUser );
|
config->userTracking()->setTracking( TrackingStyleConfig::TrackingState::EnabledByUser );
|
||||||
FALLTHRU;
|
[[fallthrough]];
|
||||||
case TrackingType::MachineTracking:
|
case TrackingType::MachineTracking:
|
||||||
config->machineTracking()->setTracking( TrackingStyleConfig::TrackingState::EnabledByUser );
|
config->machineTracking()->setTracking( TrackingStyleConfig::TrackingState::EnabledByUser );
|
||||||
FALLTHRU;
|
[[fallthrough]];
|
||||||
case TrackingType::InstallTracking:
|
case TrackingType::InstallTracking:
|
||||||
config->installTracking()->setTracking( TrackingStyleConfig::TrackingState::EnabledByUser );
|
config->installTracking()->setTracking( TrackingStyleConfig::TrackingState::EnabledByUser );
|
||||||
break;
|
break;
|
||||||
|
Loading…
Reference in New Issue
Block a user