Commit e862445ef338d475edce152442cdc43d720d18ce

Authored by Jarryd Beck
1 parent ed85f04a

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.
Showing 1 changed file with 4 additions and 0 deletions
include/cxxopts.hpp
@@ -1134,9 +1134,11 @@ namespace cxxopts @@ -1134,9 +1134,11 @@ namespace cxxopts
1134 } 1134 }
1135 1135
1136 #if defined(__GNUC__) 1136 #if defined(__GNUC__)
  1137 +#if __GNUC__ <= 10 && __GNUC_MINOR__ <= 1
1137 #pragma GCC diagnostic push 1138 #pragma GCC diagnostic push
1138 #pragma GCC diagnostic ignored "-Werror=null-dereference" 1139 #pragma GCC diagnostic ignored "-Werror=null-dereference"
1139 #endif 1140 #endif
  1141 +#endif
1140 1142
1141 CXXOPTS_NODISCARD 1143 CXXOPTS_NODISCARD
1142 size_t 1144 size_t
@@ -1146,8 +1148,10 @@ namespace cxxopts @@ -1146,8 +1148,10 @@ namespace cxxopts
1146 } 1148 }
1147 1149
1148 #if defined(__GNUC__) 1150 #if defined(__GNUC__)
  1151 +#if __GNUC__ <= 10 && __GNUC_MINOR__ <= 1
1149 #pragma GCC diagnostic pop 1152 #pragma GCC diagnostic pop
1150 #endif 1153 #endif
  1154 +#endif
1151 1155
1152 // TODO: maybe default options should count towards the number of arguments 1156 // TODO: maybe default options should count towards the number of arguments
1153 CXXOPTS_NODISCARD 1157 CXXOPTS_NODISCARD