Skip to content

Commit

Permalink
libconfig: rebuild libconfig
Browse files Browse the repository at this point in the history
  • Loading branch information
Helianthella committed May 7, 2020
1 parent 01dd499 commit ed061fe
Show file tree
Hide file tree
Showing 8 changed files with 1,344 additions and 609 deletions.
8 changes: 7 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,10 @@
*.c diff=cpp
*.sln merge=union
*.vcproj merge=union
*.vcxproj merge=union
*.vcxproj merge=union

# libconfig generated files
3rdparty/libconfig/grammar.c linguist-generated=true
3rdparty/libconfig/grammar.h linguist-generated=true
3rdparty/libconfig/scanner.c linguist-generated=true
3rdparty/libconfig/scanner.h linguist-generated=true
2 changes: 2 additions & 0 deletions 3rdparty/libconfig/extra/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@
/config.status
/gen/*.c
/gen/*.h
/gen/*.orig
/gen/*.rej
/autom4te.cache
4 changes: 2 additions & 2 deletions 3rdparty/libconfig/extra/gen/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ LEXCOMPILE = $(LEX) $(LFLAGS) $(AM_LFLAGS)
YLWRAP = ../aux-build/ylwrap
YACCCOMPILE = $(YACC) $(YFLAGS) $(AM_YFLAGS)
LEX = flex
LEXLIB = -ll
LEXLIB = -lfl
LEX_OUTPUT_ROOT = lex.yy
SHELL = /bin/sh
SHELL = /bin/bash
YACC = bison -y
YFLAGS =

Expand Down
14 changes: 7 additions & 7 deletions 3rdparty/libconfig/extra/gen/clangwarnings.patch
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ index 3595578..26444f8 100644
- yymsg = "Deleting";
- YY_SYMBOL_PRINT (yymsg, 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
Expand All @@ -22,15 +22,15 @@ index 60882db..8b8af33 100644
#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);
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 );
yy_init_buffer( YY_CURRENT_BUFFER, input_file , yyscanner);
yy_load_buffer_state( yyscanner );
}
Loading

0 comments on commit ed061fe

Please sign in to comment.