Skip to content

Commit

Permalink
flex_array: declare parts member to have incomplete type
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
rientjes authored and torvalds committed Aug 27, 2009
1 parent 105b6e8 commit 8e7ee27
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/linux/flex_array.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 8e7ee27

Please sign in to comment.