mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-26 19:00:25 +00:00
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: David Rientjes <rientjes@google.com> Acked-by: Dave Hansen <dave@linux.vnet.ibm.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
105b6e8a74
commit
8e7ee27095
1 changed files with 1 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue