diff options
author | Tobias Klauser <tklauser@distanz.ch> | 2017-01-13 11:50:09 +0100 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2017-01-16 11:32:46 +0100 |
commit | 6876487abd8041cd2a718ed7dd9ff6d86560b1ee (patch) | |
tree | cd0697808b0e04d27d9f70d585ef7e52d6a50161 /src/expr/cmp.c | |
parent | 046c3a145dc05cba8063c6702c4d60db079950d9 (diff) |
expr: Add const qualifiers to *2str translation arrays
Add const qualifiers to the "to string" translation arrays used by
various *2str() functions.
This fixes GCC warnings such as the following when compiling with
-Wwrite-strings:
expr/byteorder.c:176:25: warning: initialization discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
In order to catch these in the future, also add -Wwrite-strings to
default CFLAGS.
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src/expr/cmp.c')
-rw-r--r-- | src/expr/cmp.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/expr/cmp.c b/src/expr/cmp.c index e7ed0db..353e907 100644 --- a/src/expr/cmp.c +++ b/src/expr/cmp.c @@ -139,7 +139,7 @@ nftnl_expr_cmp_parse(struct nftnl_expr *e, struct nlattr *attr) return ret; } -static char *expr_cmp_str[] = { +static const char *expr_cmp_str[] = { [NFT_CMP_EQ] = "eq", [NFT_CMP_NEQ] = "neq", [NFT_CMP_LT] = "lt", |