Browse Source

Ignore warnings from bison, do not try to fix them

Some attempts to fix `-Wimplicit-fallthrough` are also visible.
This warning was not enabled by default so there should be no need to ignore it.
c285009965d42ab59060edad82d2af1715d686b8
thegeorg 9 months ago
parent
commit
d49315affa

+ 4 - 0
build/ymake.core.conf

@@ -3385,6 +3385,7 @@ when ($CLANG == "yes") {
     _LANG_CFLAGS_RL=-Wno-implicit-fallthrough -fno-profile-instr-generate -fno-coverage-mapping
     _LANG_CFLAGS_SWG=-Wno-deprecated-declarations -fno-profile-instr-generate -fno-coverage-mapping
     _LANG_CFLAGS_LEX=-Wno-unused-variable -fno-profile-instr-generate -fno-coverage-mapping
+    _LANG_CFLAGS_BISON=-Wno-unused-but-set-variable -fno-profile-instr-generate -fno-coverage-mapping
 }
 otherwise {
     _LANG_CFLAGS_FILTER=\
@@ -3394,6 +3395,7 @@ otherwise {
     _LANG_CFLAGS_RL=-Wno-implicit-fallthrough
     _LANG_CFLAGS_SWG=-Wno-deprecated-declarations
     _LANG_CFLAGS_LEX=-Wno-unused-variable
+    _LANG_CFLAGS_BISON=-Wno-unused-but-set-variable
 }
 
 # tag:src-processing
@@ -3415,6 +3417,8 @@ _LANG_CFLAGS_VALUE_NEW=
 when ($CLANG == "yes" || $CLANG_CL == "yes" || $GCC == "yes") {
     _LANG_CFLAGS_VALUE=$_LANG_CFLAGS(${noext:SRC})
     _LANG_CFLAGS_VALUE_NEW=\
+        ${pre=$_LANG_CFLAGS_BISON;clear;ext=.y;noext;input:SRC} \
+        ${pre=$_LANG_CFLAGS_BISON;clear;ext=.ypp;noext;input:SRC} \
         ${pre=$_LANG_CFLAGS_RL;clear;ext=.rl5;noext;input:SRC} \
         ${pre=$_LANG_CFLAGS_RL;clear;ext=.rl6;noext;input:SRC} \
         ${pre=$_LANG_CFLAGS_RL;clear;ext=.pyx;noext;input:SRC} \

+ 1 - 1
contrib/tools/bison/data/lalr1.cc

@@ -711,7 +711,7 @@ m4_if(b4_prefix, [yy], [],
     int yylen = 0;
 
     // Error handling.
-    __attribute__((unused)) int yynerrs_ = 0;
+    int yynerrs_ = 0;
     int yyerrstatus_ = 0;
 
     /// The lookahead symbol.

+ 2 - 8
contrib/tools/bison/data/yacc.c

@@ -198,7 +198,7 @@ int yynerrs;]])])
 # between calls to yypush_parse.
 m4_define([b4_declare_parser_state_variables], [b4_pure_if([[
     /* Number of syntax errors so far.  */
-    __attribute__((unused)) int yynerrs;
+    int yynerrs;
 ]])[
     int yystate;
     /* Number of tokens to shift before error messages enabled.  */
@@ -770,7 +770,6 @@ int yydebug;
 # define YYMAXDEPTH ]b4_stack_depth_max[
 #endif]b4_lac_if([[
 
-
 /* Given a state stack such that *YYBOTTOM is its bottom, such that
    *YYTOP is either its top or is YYTOP_EMPTY to indicate an empty
    stack, and such that *YYCAPACITY is the maximum number of elements it
@@ -1054,11 +1053,6 @@ yy_lac (yytype_int16 *yyesa, yytype_int16 **yyes,
    backslash-backslash).  YYSTR is taken from yytname.  If YYRES is
    null, do not copy; instead, return the length of what the result
    would have been.  */
-#ifdef __cplusplus
-# define BISON_FALLTHROUGH [[fallthrough]]
-#else
-# define BISON_FALLTHROUGH
-#endif
 static YYSIZE_T
 yytnamerr (char *yyres, const char *yystr)
 {
@@ -1077,7 +1071,7 @@ yytnamerr (char *yyres, const char *yystr)
           case '\\':
             if (*++yyp != '\\')
               goto do_not_strip_quotes;
-            BISON_FALLTHROUGH;
+            /* Fall through.  */
           default:
             if (yyres)
               yyres[yyn] = *yyp;

+ 2 - 3
contrib/tools/bison/src/scan-skel.c

@@ -42,11 +42,10 @@
 #endif
 
 /* %if-c++-only */
-#define BISON_FALLTHROUGH [[fallthrough]]
 /* %endif */
 
 /* %if-c-only */
-#define BISON_FALLTHROUGH 
+  
 /* %endif */
 
 /* %if-c-only */
@@ -1619,7 +1618,7 @@ static int yy_get_next_buffer (void)
 					/* Reset buffer status. */
 					skel_restart(skel_in );
 
-					BISON_FALLTHROUGH;
+					/*FALLTHROUGH*/
 
 				case EOB_ACT_END_OF_FILE:
 					{