CMake: restore NOTREACHED, without the macro-mess

- gcc (up to at least version 10) is worse at recognizing that all
  cases have been handled, so it complains about all the switches
  that cover enum values.
main
Adriaan de Groot 6 years ago
parent fea403186f
commit 98c7cec732

@ -271,6 +271,7 @@ flavoredWidget( Calamares::Branding::PanelFlavor flavor,
case Calamares::Branding::PanelFlavor::None: case Calamares::Branding::PanelFlavor::None:
return nullptr; return nullptr;
} }
__builtin_unreachable();
} }
/** @brief Adds widgets to @p layout if they belong on this @p side /** @brief Adds widgets to @p layout if they belong on this @p side

@ -139,6 +139,7 @@ PartitionSize::toBytes( qint64 totalSectors, qint64 sectorSize ) const
case SizeUnit::GiB: case SizeUnit::GiB:
return toBytes(); return toBytes();
} }
__builtin_unreachable();
} }
qint64 qint64
@ -175,7 +176,7 @@ PartitionSize::toBytes( qint64 totalBytes ) const
case SizeUnit::GiB: case SizeUnit::GiB:
return toBytes(); return toBytes();
} }
__builtin_unreachable();
} }
qint64 qint64
@ -206,6 +207,7 @@ PartitionSize::toBytes() const
case SizeUnit::GiB: case SizeUnit::GiB:
return CalamaresUtils::GiBtoBytes( static_cast< unsigned long long >( value() ) ); return CalamaresUtils::GiBtoBytes( static_cast< unsigned long long >( value() ) );
} }
__builtin_unreachable();
} }
bool bool
@ -231,6 +233,7 @@ PartitionSize::operator<( const PartitionSize& other ) const
case SizeUnit::GiB: case SizeUnit::GiB:
return ( toBytes() < other.toBytes() ); return ( toBytes() < other.toBytes() );
} }
__builtin_unreachable();
} }
bool bool
@ -256,6 +259,7 @@ PartitionSize::operator>( const PartitionSize& other ) const
case SizeUnit::GiB: case SizeUnit::GiB:
return ( toBytes() > other.toBytes() ); return ( toBytes() > other.toBytes() );
} }
__builtin_unreachable();
} }
bool bool
@ -281,6 +285,7 @@ PartitionSize::operator==( const PartitionSize& other ) const
case SizeUnit::GiB: case SizeUnit::GiB:
return ( toBytes() == other.toBytes() ); return ( toBytes() == other.toBytes() );
} }
__builtin_unreachable();
} }
} // namespace Partition } // namespace Partition

@ -52,6 +52,7 @@ yamlToVariant( const YAML::Node& node )
case YAML::NodeType::Undefined: case YAML::NodeType::Undefined:
return QVariant(); return QVariant();
} }
__builtin_unreachable();
} }

@ -43,6 +43,7 @@ Config::status() const
case Status::FailedNetworkError: case Status::FailedNetworkError:
return tr( "Network Installation. (Disabled: Unable to fetch package lists, check your network connection)" ); return tr( "Network Installation. (Disabled: Unable to fetch package lists, check your network connection)" );
} }
__builtin_unreachable();
} }

@ -110,6 +110,7 @@ PackageChooserViewStep::isNextEnabled() const
// exactly one OR one or more // exactly one OR one or more
return m_widget->hasSelection(); return m_widget->hasSelection();
} }
__builtin_unreachable();
} }

Loading…
Cancel
Save