Ignore gcc-10 warning

This warning trigger build errors, those pragma are a bit ugly but they prevent the build error.

```
In file included from /home/benjamin.sergeant/src/ALHttp-Cpp/build/_deps/cxxopts-src/src/example.cpp:27:
/home/benjamin.sergeant/src/ALHttp-Cpp/build/_deps/cxxopts-src/include/cxxopts.hpp: In member function ‘size_t cxxopts::ParseResult::count(const string&) const’:
/home/benjamin.sergeant/src/ALHttp-Cpp/build/_deps/cxxopts-src/include/cxxopts.hpp:1027:14: error: potential null pointer dereference [-Werror=null-dereference]
 1027 |       return m_count;
      |              ^~~~~~~
```
This commit is contained in:
Benjamin Sergeant 2021-01-07 18:04:49 -08:00 committed by GitHub
parent 2d8e17c4f8
commit ab0b7034cf
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