summaryrefslogtreecommitdiff
path: root/3rdparty
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2016-07-12 01:21:04 +0200
committerHaru <haru@dotalux.com>2016-11-19 21:08:10 +0100
commit71cfb20ebbb191d3b5521ed9196ae6b45e55630f (patch)
tree4c4fc8471f19dc10fc7f15b4547f1248bd6d1e1b /3rdparty
parentbe7721fa1ba90d80ad0d58f2362b658831e39b2f (diff)
downloadhercules-71cfb20ebbb191d3b5521ed9196ae6b45e55630f.tar.gz
hercules-71cfb20ebbb191d3b5521ed9196ae6b45e55630f.tar.bz2
hercules-71cfb20ebbb191d3b5521ed9196ae6b45e55630f.tar.xz
hercules-71cfb20ebbb191d3b5521ed9196ae6b45e55630f.zip
Fix a compiler warning from libconfig on gcc-6 and -O3
Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to '3rdparty')
-rw-r--r--3rdparty/libconfig/extra/gen/clangwarnings.patch21
-rw-r--r--3rdparty/libconfig/scanner.c3
2 files changed, 24 insertions, 0 deletions
diff --git a/3rdparty/libconfig/extra/gen/clangwarnings.patch b/3rdparty/libconfig/extra/gen/clangwarnings.patch
index 11e6028b6..0270dfc44 100644
--- a/3rdparty/libconfig/extra/gen/clangwarnings.patch
+++ b/3rdparty/libconfig/extra/gen/clangwarnings.patch
@@ -13,3 +13,24 @@ index 3595578..26444f8 100644
YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
YYUSE (yytype);
+diff --git a/scanner.c b/scanner.c
+index 60882db..8b8af33 100644
+--- a/scanner.c
++++ b/scanner.c
+@@ -21,6 +21,7 @@
+ #include <string.h>
+ #include <errno.h>
+ #include <stdlib.h>
++#include <assert.h>
+
+ /* end standard C headers. */
+
+@@ -1702,6 +1703,8 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
+ libconfig_yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner);
+ }
+
++ assert(YY_CURRENT_BUFFER != NULL); // Fixes compiler warning -Wnull-dereference on gcc-6 and -O3
++
+ libconfig_yy_init_buffer(YY_CURRENT_BUFFER,input_file ,yyscanner);
+ libconfig_yy_load_buffer_state(yyscanner );
+ }
diff --git a/3rdparty/libconfig/scanner.c b/3rdparty/libconfig/scanner.c
index 687b52dbe..cfdd02ccf 100644
--- a/3rdparty/libconfig/scanner.c
+++ b/3rdparty/libconfig/scanner.c
@@ -21,6 +21,7 @@
#include <string.h>
#include <errno.h>
#include <stdlib.h>
+#include <assert.h>
/* end standard C headers. */
@@ -1702,6 +1703,8 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
libconfig_yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner);
}
+ assert(YY_CURRENT_BUFFER != NULL); // Fixes compiler warning -Wnull-dereference on gcc-6 and -O3
+
libconfig_yy_init_buffer(YY_CURRENT_BUFFER,input_file ,yyscanner);
libconfig_yy_load_buffer_state(yyscanner );
}