From e862445ef338d475edce152442cdc43d720d18ce Mon Sep 17 00:00:00 2001 From: Jarryd Beck Date: Sat, 23 Jan 2021 14:08:56 +1100 Subject: [PATCH] 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. --- include/cxxopts.hpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/cxxopts.hpp b/include/cxxopts.hpp index 3cc57a5..01ce035 100644 --- a/include/cxxopts.hpp +++ b/include/cxxopts.hpp @@ -1134,8 +1134,10 @@ 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 @@ -1146,7 +1148,9 @@ 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