flex_array: declare parts member to have incomplete type
authorDavid Rientjes <[email protected]>
Wed, 26 Aug 2009 21:29:21 +0000 (14:29 -0700)
committerLinus Torvalds <[email protected]>
Thu, 27 Aug 2009 03:06:52 +0000 (20:06 -0700)
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 <[email protected]>
Acked-by: Dave Hansen <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
include/linux/flex_array.h

index 23c1ec79a31b224470cc0d8e235ebc0a661baa17..603160db7c98ea58d2cb660d11d0211023045447 100644 (file)
@@ -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