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:
authorJarryd Beck <jarro.2783@gmail.com>2021-01-23 06:08:56 +0300
committerJarryd Beck <jarro.2783@gmail.com>2021-01-23 06:08:56 +0300
commite862445ef338d475edce152442cdc43d720d18ce (patch)
tree137e3234889dfd5a7cbd36f81925ad5cc64b207c
parented85f04a1b4e6a472f8973971c1f6c69b8afc02f (diff)
Fix null dereference warning error
Fixes #276. Remove the fix for null dereference warning for GCC after 10.1.0 because this was removed in later versions.
-rw-r--r--include/cxxopts.hpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/cxxopts.hpp b/include/cxxopts.hpp
index 3cc57a5..01ce035 100644
--- a/include/cxxopts.hpp
+++ b/include/cxxopts.hpp
@@ -1134,9 +1134,11 @@ namespace cxxopts
}
#if defined(__GNUC__)
+#if __GNUC__ <= 10 && __GNUC_MINOR__ <= 1
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Werror=null-dereference"
#endif
+#endif
CXXOPTS_NODISCARD
size_t
@@ -1146,8 +1148,10 @@ namespace cxxopts
}
#if defined(__GNUC__)
+#if __GNUC__ <= 10 && __GNUC_MINOR__ <= 1
#pragma GCC diagnostic pop
#endif
+#endif
// TODO: maybe default options should count towards the number of arguments
CXXOPTS_NODISCARD