Ignore gcc-10 warning (#273)

Workaround for GCC 10 null dereference warning.
This commit is contained in:
Benjamin Sergeant 2021-01-18 22:00:45 -08:00 committed by GitHub
parent dc9a7728c0
commit 834fb9999b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1133,12 +1133,21 @@ namespace cxxopts
m_value->parse();
}
#if defined(__GNUC__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Werror=null-dereference"
#endif
CXXOPTS_NODISCARD
size_t
count() const noexcept
{
return m_count;
}
#if defined(__GNUC__)
#pragma GCC diagnostic pop
#endif
// TODO: maybe default options should count towards the number of arguments
CXXOPTS_NODISCARD