From: Tobias Brunner Date: Wed, 10 Jan 2024 17:04:32 +0000 (+0100) Subject: Suppress compiler warnings with specific bison and compiler combinations X-Git-Tag: android-2.5.0~22 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=67f09905305c93620f552b8f9084b5df40e920cf;p=thirdparty%2Fstrongswan.git Suppress compiler warnings with specific bison and compiler combinations Bison generates code that only increases the yynerrs counter, it's never read. This causes a warning in newer compilers (in particular clang). Newer versions of bison mark yynerrs with __attribute__((unused)), but at least on FreeBSD 14 that's not yet available. --- diff --git a/src/libstrongswan/settings/settings_parser.y b/src/libstrongswan/settings/settings_parser.y index a231d959cb..ce67a8c5b6 100644 --- a/src/libstrongswan/settings/settings_parser.y +++ b/src/libstrongswan/settings/settings_parser.y @@ -193,6 +193,8 @@ value: } free($1); free($2); + /* suppress compiler warning */ + (void)yynerrs; } ; diff --git a/src/starter/parser/parser.y b/src/starter/parser/parser.y index 654632bc1d..e1188babcd 100644 --- a/src/starter/parser/parser.y +++ b/src/starter/parser/parser.y @@ -201,6 +201,8 @@ value: } free($1); free($2); + /* suppress compiler warning */ + (void)yynerrs; } ;