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.
This commit is contained in:
Adriaan de Groot 2020-10-25 18:52:38 +01:00
parent fea403186f
commit 98c7cec732
5 changed files with 10 additions and 1 deletions

View file

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

View file

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

View file

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

View file

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

View file

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