Skip to content

Commit 5580de0

Browse files
anchaoxiaoxiang781216
authored andcommitted
net/netfilter: fix visual studio Compiler Error C2229
D:\archer\code\nuttx\include\nuttx/net/netfilter/x_tables.h(71,7): error C2229: type 'struct xt_standard_target' has an illegal zero-sized array Compiler error C2229: A member of a structure or bit field contains a zero-sized array that is not the last member. Reference: https://learn.microsoft.com/en-us/cpp/error-messages/compiler-errors-1/compiler-error-c2229?view=msvc-170 Signed-off-by: chao an <anchao@xiaomi.com>
1 parent ccaa625 commit 5580de0

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

include/nuttx/net/netfilter/ip_tables.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ struct ipt_entry
117117

118118
struct xt_counters counters; /* Packet and byte counters. */
119119

120-
unsigned char elems[0]; /* The matches (if any), then the target. */
120+
unsigned char elems[1]; /* The matches (if any), then the target. */
121121
};
122122

123123
/* Note 1: How entries are organized in following interface arguments.

include/nuttx/net/netfilter/x_tables.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ struct xt_entry_target
6262
uint16_t target_size; /* Total length */
6363
} u;
6464

65-
unsigned char data[0];
65+
unsigned char data[1];
6666
};
6767

6868
struct xt_standard_target

0 commit comments

Comments
 (0)