]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
Suppress compiler warnings with specific bison and compiler combinations
authorTobias Brunner <tobias@strongswan.org>
Wed, 10 Jan 2024 17:04:32 +0000 (18:04 +0100)
committerTobias Brunner <tobias@strongswan.org>
Tue, 16 Jan 2024 10:00:29 +0000 (11:00 +0100)
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.

src/libstrongswan/settings/settings_parser.y
src/starter/parser/parser.y

index a231d959cb2193df644a9dcb1d411b64d427cb0e..ce67a8c5b671e0097281773a9e206456f01932ed 100644 (file)
@@ -193,6 +193,8 @@ value:
                }
                free($1);
                free($2);
+               /* suppress compiler warning */
+               (void)yynerrs;
        }
        ;
 
index 654632bc1d17a45d7c435e7029e8adc0b9513c92..e1188babcdd6580c876d73108cbad86a7eea05ad 100644 (file)
@@ -201,6 +201,8 @@ value:
                }
                free($1);
                free($2);
+               /* suppress compiler warning */
+               (void)yynerrs;
        }
        ;