archive/ArchiveList, input/Registry: avoid zero-sized array

Some more `-Wpedantic` fixups.
This commit is contained in:
Max Kellermann
2020-05-27 16:30:44 +02:00
parent 8fdc6dec44
commit caec384ed0
2 changed files with 10 additions and 2 deletions

View File

@@ -83,7 +83,11 @@ const InputPlugin *const input_plugins[] = {
nullptr
};
bool input_plugins_enabled[std::size(input_plugins) - 1];
static constexpr std::size_t n_input_plugins = std::size(input_plugins) - 1;
/* the std::max() is just here to avoid a zero-sized array, which is
forbidden in C++ */
bool input_plugins_enabled[std::max(n_input_plugins, std::size_t(1))];
bool
HasRemoteTagScanner(const char *uri) noexcept