diff options
author | Jarryd Beck <jarro.2783@gmail.com> | 2021-01-23 06:08:56 +0300 |
---|---|---|
committer | Jarryd Beck <jarro.2783@gmail.com> | 2021-01-23 06:08:56 +0300 |
commit | e862445ef338d475edce152442cdc43d720d18ce (patch) | |
tree | 137e3234889dfd5a7cbd36f81925ad5cc64b207c | |
parent | ed85f04a1b4e6a472f8973971c1f6c69b8afc02f (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.hpp | 4 |
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 |