* [PATCH libnetfilter_conntrack] src: Make the library compile under clang
@ 2016-08-14 20:59 Kevin Cernekee
2016-08-17 15:05 ` Pablo Neira Ayuso
0 siblings, 1 reply; 2+ messages in thread
From: Kevin Cernekee @ 2016-08-14 20:59 UTC (permalink / raw)
To: pablo; +Cc: netfilter-devel
clang treats "char buffer[size]" inside a union as VLAIS unless |size|
is const:
src/conntrack/api.c:992:8: error: fields must have a constant size: 'variable length array in structure' extension will never be supported
char buffer[size];
^
Signed-off-by: Kevin Cernekee <cernekee@chromium.org>
---
src/conntrack/api.c | 4 ++--
src/expect/api.c | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/conntrack/api.c b/src/conntrack/api.c
index e4d4acc312bb..bed2e42c8f43 100644
--- a/src/conntrack/api.c
+++ b/src/conntrack/api.c
@@ -955,7 +955,7 @@ int nfct_query(struct nfct_handle *h,
const enum nf_conntrack_query qt,
const void *data)
{
- size_t size = 4096; /* enough for now */
+ const size_t size = 4096; /* enough for now */
union {
char buffer[size];
struct nfnlhdr req;
@@ -987,7 +987,7 @@ int nfct_send(struct nfct_handle *h,
const enum nf_conntrack_query qt,
const void *data)
{
- size_t size = 4096; /* enough for now */
+ const size_t size = 4096; /* enough for now */
union {
char buffer[size];
struct nfnlhdr req;
diff --git a/src/expect/api.c b/src/expect/api.c
index 8ff20e2821e3..3f1763038ede 100644
--- a/src/expect/api.c
+++ b/src/expect/api.c
@@ -669,7 +669,7 @@ int nfexp_query(struct nfct_handle *h,
const enum nf_conntrack_query qt,
const void *data)
{
- size_t size = 4096; /* enough for now */
+ const size_t size = 4096; /* enough for now */
union {
char buffer[size];
struct nfnlhdr req;
@@ -701,7 +701,7 @@ int nfexp_send(struct nfct_handle *h,
const enum nf_conntrack_query qt,
const void *data)
{
- size_t size = 4096; /* enough for now */
+ const size_t size = 4096; /* enough for now */
union {
char buffer[size];
struct nfnlhdr req;
--
2.8.0.rc3.226.g39d4020
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH libnetfilter_conntrack] src: Make the library compile under clang
2016-08-14 20:59 [PATCH libnetfilter_conntrack] src: Make the library compile under clang Kevin Cernekee
@ 2016-08-17 15:05 ` Pablo Neira Ayuso
0 siblings, 0 replies; 2+ messages in thread
From: Pablo Neira Ayuso @ 2016-08-17 15:05 UTC (permalink / raw)
To: Kevin Cernekee; +Cc: netfilter-devel
On Sun, Aug 14, 2016 at 01:59:01PM -0700, Kevin Cernekee wrote:
> clang treats "char buffer[size]" inside a union as VLAIS unless |size|
> is const:
>
> src/conntrack/api.c:992:8: error: fields must have a constant size: 'variable length array in structure' extension will never be supported
> char buffer[size];
> ^
Applied, thanks.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-08-17 15:06 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-08-14 20:59 [PATCH libnetfilter_conntrack] src: Make the library compile under clang Kevin Cernekee
2016-08-17 15:05 ` Pablo Neira Ayuso
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).