From e8b6646b2487b84789d1f06f5c948337a91d1230 Mon Sep 17 00:00:00 2001 From: Jeremy Sowden Date: Sat, 26 Aug 2023 17:32:25 +0100 Subject: read_config_yy: correct `yyerror` prototype Change it to take a `const char *`. It doesn't modify the string and yacc passes string literals, so cause compiler warnings. Signed-off-by: Jeremy Sowden Signed-off-by: Pablo Neira Ayuso --- src/read_config_yy.y | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/read_config_yy.y b/src/read_config_yy.y index f06c6af..be927c0 100644 --- a/src/read_config_yy.y +++ b/src/read_config_yy.y @@ -47,7 +47,7 @@ extern char *yytext; extern int yylineno; int yylex (void); -int yyerror (char *msg); +int yyerror (const char *msg); void yyrestart (FILE *input_file); struct ct_conf conf; @@ -1681,7 +1681,7 @@ helper_policy_expect_timeout: T_HELPER_EXPECT_TIMEOUT T_NUMBER %% int __attribute__((noreturn)) -yyerror(char *msg) +yyerror(const char *msg) { dlog(LOG_ERR, "parsing config file in line (%d), symbol '%s': %s", yylineno, yytext, msg); -- cgit v1.2.3