提交 8e7ee270 编写于 作者: D David Rientjes 提交者: Linus Torvalds

flex_array: declare parts member to have incomplete type

The `parts' member of struct flex_array should evaluate to an incomplete
type so that sizeof() cannot be used and C99 does not require the
zero-length specification.
Signed-off-by: NDavid Rientjes <rientjes@google.com>
Acked-by: NDave Hansen <dave@linux.vnet.ibm.com>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 105b6e8a
......@@ -21,7 +21,7 @@ struct flex_array {
struct {
int element_size;
int total_nr_elements;
struct flex_array_part *parts[0];
struct flex_array_part *parts[];
};
/*
* This little trick makes sure that
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册