summaryrefslogtreecommitdiff
path: root/3rdparty/libconfig/extra
diff options
context:
space:
mode:
Diffstat (limited to '3rdparty/libconfig/extra')
-rw-r--r--3rdparty/libconfig/extra/gen/clangwarnings.patch27
-rw-r--r--3rdparty/libconfig/extra/gen/scanner.l2
2 files changed, 25 insertions, 4 deletions
diff --git a/3rdparty/libconfig/extra/gen/clangwarnings.patch b/3rdparty/libconfig/extra/gen/clangwarnings.patch
index c3b45ef33..0270dfc44 100644
--- a/3rdparty/libconfig/extra/gen/clangwarnings.patch
+++ b/3rdparty/libconfig/extra/gen/clangwarnings.patch
@@ -2,14 +2,35 @@ diff --git a/grammar.c b/grammar.c
index 3595578..26444f8 100644
--- a/grammar.c
+++ b/grammar.c
-@@ -1211,9 +1211,7 @@ void libconfig_yyerror(void *scanner, struct parse_context *ctx,
+@@ -1084,9 +1084,7 @@ void libconfig_yyerror(void *scanner, struct parse_context *ctx,
+ YYUSE (scanner);
YYUSE (ctx);
YYUSE (scan_ctx);
-
- if (!yymsg)
- yymsg = "Deleting";
- YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
-+ YY_SYMBOL_PRINT (yymsg ? yymsg : "Deleting", yytype, yyvaluep, yylocationp);
++ YY_SYMBOL_PRINT (yymsg != NULL ? yymsg : "Deleting", yytype, yyvaluep, yylocationp);
+ 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/extra/gen/scanner.l b/3rdparty/libconfig/extra/gen/scanner.l
index f717ac273..60ede1ca7 100644
--- a/3rdparty/libconfig/extra/gen/scanner.l
+++ b/3rdparty/libconfig/extra/gen/scanner.l
@@ -88,7 +88,7 @@ static unsigned long long fromhex(const char *s)
true [Tt][Rr][Uu][Ee]
false [Ff][Aa][Ll][Ss][Ee]
-name [A-Za-z0-9\*][-A-Za-z0-9_\*'.]*
+name [A-Za-z0-9\*][-A-Za-z0-9_\*.]*
integer [-+]?[0-9]+
integer64 [-+]?[0-9]+L(L)?
hex 0[Xx][0-9A-Fa-f]+