Silence -Wunused-but-set-variable error with clang
authorSimon Marchi <simon.marchi@efficios.com>
Thu, 4 Aug 2022 18:28:25 +0000 (14:28 -0400)
committerSimon Marchi <simon.marchi@efficios.com>
Thu, 18 Aug 2022 20:06:53 +0000 (16:06 -0400)
commit2ea09241f07f1dfd4b6fd0f2f296a10142fda7d2
tree80fe0e3d1752ffb9c5950b4b5af08f0f861e9f2b
parent42fc5ffd68859cf70ab45e2091975e890813ed54
Silence -Wunused-but-set-variable error with clang

When building with clang-15, I get:

      CXX      libctf_parser_la-parser.lo
    parser.cpp:2920:9: error: variable 'yynerrs' set but not used [-Werror,-Wunused-but-set-variable]
        int yynerrs;
            ^

This is because it warns for something like this:

    int n;
    n = 0;
    ++n;

whereas previous versions do not.

This is generated code, so there's not much more we can do other than
silence the warning for the file.

Change-Id: If2cffe9042b743ffe4b4b23f751216f67b58e5fa
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/8655
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
src/common/macros.h
src/plugins/ctf/common/metadata/parser.ypp
This page took 0.025116 seconds and 4 git commands to generate.