Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/jarro2783/cxxopts.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Sergeant <bsergean@gmail.com>2021-01-19 09:00:45 +0300
committerGitHub <noreply@github.com>2021-01-19 09:00:45 +0300
commit834fb9999bc906693f1abaf257acbddbc57a6f48 (patch)
treec6a6d1a016e7a94617c0bbc9721a7901407cdf54 /include
parentdc9a7728c0e395af0e987f315551213245cd11d1 (diff)
Ignore gcc-10 warning (#273)
Workaround for GCC 10 null dereference warning.
Diffstat (limited to 'include')
-rw-r--r--include/cxxopts.hpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/cxxopts.hpp b/include/cxxopts.hpp
index 6ec7998..e491b2e 100644
--- a/include/cxxopts.hpp
+++ b/include/cxxopts.hpp
@@ -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