Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Warnings detected thanks to Xcode's compiler settings (more strict by default) and clang, warnings mostly but not only related to data sizes on 64 bit systems, that were silenced until now by very lax compiler settings. - This also decreases by a great deal the amount of warnings produced by MSVC in x64 mode (for the adventurous ones who tried that) - Also fixed (or silenced in case of false positives) the potential issues pointed out by the (awesome) clang static analyzer. - Patch co-produced with Ind, I'm merging and committing in his place! Signed-off-by: Haru <haru@dotalux.com>
- Loading branch information
1 parent
a23d072
commit 15a0f6d
Showing
61 changed files
with
878 additions
and
690 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
diff --git a/grammar.c b/grammar.c | ||
index 3595578..26444f8 100644 | ||
--- a/grammar.c | ||
+++ b/grammar.c | ||
@@ -1187,9 +1187,7 @@ void libconfig_yyerror(void *scanner, struct parse_context *ctx, | ||
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); | ||
|
||
switch (yytype) | ||
{ | ||
diff --git a/scanner.c b/scanner.c | ||
index aebd34c..c3a717f 100644 | ||
--- a/scanner.c | ||
+++ b/scanner.c | ||
@@ -1500,6 +1500,8 @@ static int yy_get_next_buffer (yyscan_t yyscanner) | ||
else | ||
ret_val = EOB_ACT_CONTINUE_SCAN; | ||
|
||
+#ifndef __clang_analyzer__ | ||
+ // FIXME: Clang's static analyzer complains about leaking the result of libconfig_yyrealloc | ||
if ((yy_size_t) (yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { | ||
/* Extend the array by 50%, plus the number we really need. */ | ||
yy_size_t new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1); | ||
@@ -1507,6 +1509,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner) | ||
if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) | ||
YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); | ||
} | ||
+#endif // __clang_analyzer__ | ||
|
||
yyg->yy_n_chars += number_to_move; | ||
YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] = YY_END_OF_BUFFER_CHAR; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.