]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
netlink: avoid "-Wenum-conversion" warning in parser_bison.y
authorThomas Haller <thaller@redhat.com>
Tue, 29 Aug 2023 12:53:31 +0000 (14:53 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Tue, 29 Aug 2023 17:50:10 +0000 (19:50 +0200)
Clang warns:

    parser_bison.y:3658:83: error: implicit conversion from enumeration type 'enum nft_nat_types' to different enumeration type 'enum nft_nat_etypes' [-Werror,-Wenum-conversion]
                                            { (yyval.stmt) = nat_stmt_alloc(&(yyloc), NFT_NAT_SNAT); }
                                                             ~~~~~~~~~~~~~~           ^~~~~~~~~~~~
    parser_bison.y:3659:83: error: implicit conversion from enumeration type 'enum nft_nat_types' to different enumeration type 'enum nft_nat_etypes' [-Werror,-Wenum-conversion]
                                            { (yyval.stmt) = nat_stmt_alloc(&(yyloc), NFT_NAT_DNAT); }
                                                             ~~~~~~~~~~~~~~           ^~~~~~~~~~~~

Signed-off-by: Thomas Haller <thaller@redhat.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
src/parser_bison.y

index 7b8eac9577ef3f11fa21729cccb0126c4602f589..14aab1933d155239dcc6699843ac642f45c952ff 100644 (file)
@@ -3660,8 +3660,8 @@ reject_opts               :       /* empty */
 nat_stmt               :       nat_stmt_alloc  nat_stmt_args
                        ;
 
-nat_stmt_alloc         :       SNAT    { $$ = nat_stmt_alloc(&@$, NFT_NAT_SNAT); }
-                       |       DNAT    { $$ = nat_stmt_alloc(&@$, NFT_NAT_DNAT); }
+nat_stmt_alloc         :       SNAT    { $$ = nat_stmt_alloc(&@$, __NFT_NAT_SNAT); }
+                       |       DNAT    { $$ = nat_stmt_alloc(&@$, __NFT_NAT_DNAT); }
                        ;
 
 tproxy_stmt            :       TPROXY TO stmt_expr