Commit 8e7ee270 authored by David Rientjes's avatar David Rientjes Committed by 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: default avatarDavid Rientjes <rientjes@google.com>
Acked-by: default avatarDave Hansen <dave@linux.vnet.ibm.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 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%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment