Fix -Wduplicated-cond warnings
authorSimon Marchi <simon.marchi@efficios.com>
Fri, 25 Oct 2019 21:32:53 +0000 (17:32 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Wed, 30 Oct 2019 19:14:53 +0000 (15:14 -0400)
Fixes this:

      CC       libctf_parser_la-parser.lo
    /home/smarchi/src/babeltrace/src/plugins/ctf/common/metadata/parser.y: In function ‘yyparse’:
    /home/smarchi/src/babeltrace/src/plugins/ctf/common/metadata/parser.y:1313:50: error: duplicated ‘if’ condition [-Werror=duplicated-cond]
        } else if ($$->u.unary_expression.type == UNARY_UNSIGNED_CONSTANT) {
                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
    /home/smarchi/src/babeltrace/src/plugins/ctf/common/metadata/parser.y:1309:43: note: previously used here
        if ($$->u.unary_expression.type == UNARY_UNSIGNED_CONSTANT) {
            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~

I am pretty sure that this line should use UNARY_SIGNED_CONSTANT.

Change-Id: Icb17d79422ed78a214fb88a3a0787fcd760822d6
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/2260
Reviewed-by: Francis Deslauriers <francis.deslauriers@efficios.com>
configure.ac
src/plugins/ctf/common/metadata/parser.y

index 7c6875234113802e43d8c248f93a442838d87208..8a91ba1cc2476a3178f0c46b9cc5a03771a4d6da 100644 (file)
@@ -680,7 +680,6 @@ AX_COMPILER_FLAGS(
                -Wno-null-dereference dnl
                -Wno-jump-misses-init dnl
                -Wno-missing-include-dirs dnl
-               -Wno-duplicated-cond dnl
                -Wno-double-promotion dnl
                -Wno-cast-align dnl
        ])
index b270a83c5001b89d5b4398398420a55587eed259..16868179282c18b66da6a110becc880336d3cc68 100644 (file)
@@ -1310,7 +1310,7 @@ unary_expression:
                                $$->u.unary_expression.type = UNARY_SIGNED_CONSTANT;
                                $$->u.unary_expression.u.signed_constant =
                                        -($$->u.unary_expression.u.unsigned_constant);
-                       } else if ($$->u.unary_expression.type == UNARY_UNSIGNED_CONSTANT) {
+                       } else if ($$->u.unary_expression.type == UNARY_SIGNED_CONSTANT) {
                                $$->u.unary_expression.u.signed_constant =
                                        -($$->u.unary_expression.u.signed_constant);
                        } else {
This page took 0.026401 seconds and 4 git commands to generate.