From 6876487abd8041cd2a718ed7dd9ff6d86560b1ee Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Fri, 13 Jan 2017 11:50:09 +0100 Subject: expr: Add const qualifiers to *2str translation arrays MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Signed-off-by: Pablo Neira Ayuso --- src/expr/range.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/expr/range.c') diff --git a/src/expr/range.c b/src/expr/range.c index 1489d58..8c8ce12 100644 --- a/src/expr/range.c +++ b/src/expr/range.c @@ -159,7 +159,7 @@ nftnl_expr_range_parse(struct nftnl_expr *e, struct nlattr *attr) return ret; } -static char *expr_range_str[] = { +static const char *expr_range_str[] = { [NFT_RANGE_EQ] = "eq", [NFT_RANGE_NEQ] = "neq", }; -- cgit v1.2.3