glsl: fixes -Werror,-Wunused-but-set-variable for clang-15 in glcpp-parse.y and glsl_...
authorYonggang Luo <luoyonggang@gmail.com>
Fri, 4 Nov 2022 12:48:02 +0000 (20:48 +0800)
committerMarge Bot <emma+marge@anholt.net>
Fri, 16 Dec 2022 19:02:17 +0000 (19:02 +0000)
error messages:
src/compiler/glsl/glcpp/glcpp-parse.c:1691:9: error: variable 'glcpp_parser_nerrs' set but not used [-Werror,-Wunused-but-set-variable]
    int yynerrs = 0;
        ^

src/compiler/glsl/glsl_parser.cpp:2370:9: error: variable '_mesa_glsl_nerrs' set but not used [-Werror,-Wunused-but-set-variable]
    int yynerrs = 0;
        ^

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19875>

src/compiler/glsl/glcpp/glcpp-parse.y
src/compiler/glsl/glsl_parser.yy

index 93445e6..7456c8a 100644 (file)
@@ -785,6 +785,8 @@ junk:
          glcpp_warning(&@1, parser, "extra tokens at end of directive");
       else
          glcpp_error(&@1, parser, "extra tokens at end of directive");
+
+      (void)yynerrs;
    }
 ;
 
index 428ff53..574895b 100644 (file)
@@ -3105,5 +3105,7 @@ layout_defaults:
       if (!state->out_qualifier->push_to_global(& @1, state)) {
          YYERROR;
       }
+
+      (void)yynerrs;
    }
    ;