]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
rule: fix "const static" declaration
authorThomas Haller <thaller@redhat.com>
Tue, 29 Aug 2023 18:54:07 +0000 (20:54 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Mon, 1 Sep 2025 20:47:56 +0000 (22:47 +0200)
commit 06810e15bcfea356ccecde9317dd860b0f29df06 upstream.

Gcc warns against this with "-Wextra":

    src/rule.c:869:1: error: static is not at beginning of declaration [-Werror=old-style-declaration]
      869 | const static struct prio_tag std_prios[] = {
          | ^~~~~
    src/rule.c:878:1: error: static is not at beginning of declaration [-Werror=old-style-declaration]
      878 | const static struct prio_tag bridge_std_prios[] = {
          | ^~~~~

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

index 301e684667298b8ff20ff0c919176270f8c22a72..59defa5d5ab4f0094d721a1b9708b1357497f711 100644 (file)
@@ -871,7 +871,7 @@ struct prio_tag {
        const char *str;
 };
 
-const static struct prio_tag std_prios[] = {
+static const struct prio_tag std_prios[] = {
        { NF_IP_PRI_RAW,      "raw" },
        { NF_IP_PRI_MANGLE,   "mangle" },
        { NF_IP_PRI_NAT_DST,  "dstnat" },
@@ -880,7 +880,7 @@ const static struct prio_tag std_prios[] = {
        { NF_IP_PRI_NAT_SRC,  "srcnat" },
 };
 
-const static struct prio_tag bridge_std_prios[] = {
+static const struct prio_tag bridge_std_prios[] = {
        { NF_BR_PRI_NAT_DST_BRIDGED,  "dstnat" },
        { NF_BR_PRI_FILTER_BRIDGED,   "filter" },
        { NF_BR_PRI_NAT_DST_OTHER,    "out" },