diff --git a/CMakeLists.txt b/CMakeLists.txt index 193de8c1d..a83ed6dd8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -228,7 +228,6 @@ if( CMAKE_CXX_COMPILER_ID MATCHES "Clang" ) ) string( APPEND CMAKE_CXX_FLAGS " ${CLANG_WARNINGS}" ) endforeach() - 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 @@ -246,8 +245,6 @@ else() set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wnon-virtual-dtor -Woverloaded-virtual" ) set( SUPPRESS_3RDPARTY_WARNINGS "" ) - - set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DNOTREACHED='__builtin_unreachable();'" ) endif() # Use mark_thirdparty_code() to reduce warnings from the compiler diff --git a/src/calamares/CalamaresWindow.cpp b/src/calamares/CalamaresWindow.cpp index 0960da10a..b062c0b4d 100644 --- a/src/calamares/CalamaresWindow.cpp +++ b/src/calamares/CalamaresWindow.cpp @@ -271,7 +271,6 @@ flavoredWidget( Calamares::Branding::PanelFlavor flavor, case Calamares::Branding::PanelFlavor::None: return nullptr; } - NOTREACHED return nullptr; // All enum values handled above } /** @brief Adds widgets to @p layout if they belong on this @p side diff --git a/src/libcalamares/geoip/Handler.cpp b/src/libcalamares/geoip/Handler.cpp index 648ea69f4..68cf6ed6b 100644 --- a/src/libcalamares/geoip/Handler.cpp +++ b/src/libcalamares/geoip/Handler.cpp @@ -101,7 +101,6 @@ create_interface( Handler::Type t, const QString& selector ) case Handler::Type::Fixed: return std::make_unique< GeoIPFixed >( selector ); } - NOTREACHED return nullptr; } static RegionZonePair diff --git a/src/libcalamares/partition/PartitionSize.cpp b/src/libcalamares/partition/PartitionSize.cpp index d09cc6064..82444da6a 100644 --- a/src/libcalamares/partition/PartitionSize.cpp +++ b/src/libcalamares/partition/PartitionSize.cpp @@ -139,9 +139,6 @@ PartitionSize::toBytes( qint64 totalSectors, qint64 sectorSize ) const case SizeUnit::GiB: return toBytes(); } - - // notreached - return -1; } qint64 @@ -179,8 +176,6 @@ PartitionSize::toBytes( qint64 totalBytes ) const return toBytes(); } - // notreached - return -1; } qint64 @@ -211,7 +206,6 @@ PartitionSize::toBytes() const case SizeUnit::GiB: return CalamaresUtils::GiBtoBytes( static_cast< unsigned long long >( value() ) ); } - NOTREACHED return -1; } bool @@ -237,7 +231,6 @@ PartitionSize::operator<( const PartitionSize& other ) const case SizeUnit::GiB: return ( toBytes() < other.toBytes() ); } - NOTREACHED return false; } bool @@ -263,7 +256,6 @@ PartitionSize::operator>( const PartitionSize& other ) const case SizeUnit::GiB: return ( toBytes() > other.toBytes() ); } - NOTREACHED return false; } bool @@ -289,7 +281,6 @@ PartitionSize::operator==( const PartitionSize& other ) const case SizeUnit::GiB: return ( toBytes() == other.toBytes() ); } - NOTREACHED return false; } } // namespace Partition diff --git a/src/libcalamares/utils/Yaml.cpp b/src/libcalamares/utils/Yaml.cpp index b787589c6..f999b8bb0 100644 --- a/src/libcalamares/utils/Yaml.cpp +++ b/src/libcalamares/utils/Yaml.cpp @@ -52,9 +52,6 @@ yamlToVariant( const YAML::Node& node ) case YAML::NodeType::Undefined: return QVariant(); } - - // NOTREACHED - return QVariant(); } diff --git a/src/modules/netinstall/Config.cpp b/src/modules/netinstall/Config.cpp index ddbb36fcc..92cdcb2bf 100644 --- a/src/modules/netinstall/Config.cpp +++ b/src/modules/netinstall/Config.cpp @@ -43,7 +43,6 @@ Config::status() const case Status::FailedNetworkError: return tr( "Network Installation. (Disabled: Unable to fetch package lists, check your network connection)" ); } - NOTREACHED return QString(); } diff --git a/src/modules/netinstall/NetInstallViewStep.cpp b/src/modules/netinstall/NetInstallViewStep.cpp index beb295c32..e96d1724f 100644 --- a/src/modules/netinstall/NetInstallViewStep.cpp +++ b/src/modules/netinstall/NetInstallViewStep.cpp @@ -47,7 +47,7 @@ NetInstallViewStep::prettyName() const return m_sidebarLabel ? m_sidebarLabel->get() : tr( "Package selection" ); #if defined( TABLE_OF_TRANSLATIONS ) - NOTREACHED + __builtin_unreachable(); // This is a table of "standard" labels for this module. If you use them // in the label: sidebar: section of the config file, the existing // translations can be used. diff --git a/src/modules/packagechooser/PackageChooserViewStep.cpp b/src/modules/packagechooser/PackageChooserViewStep.cpp index f162c074b..b649e6431 100644 --- a/src/modules/packagechooser/PackageChooserViewStep.cpp +++ b/src/modules/packagechooser/PackageChooserViewStep.cpp @@ -110,8 +110,6 @@ PackageChooserViewStep::isNextEnabled() const // exactly one OR one or more return m_widget->hasSelection(); } - - NOTREACHED return true; }