projects/linux·commit 8e7ee270

flex_array: declare parts member to have incomplete type

8e7ee270 · David Rientjes <[email protected]> · 2009-08-26 14:29:21 -07:00

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]>
Commit
8e7ee27095aee87b5db1b0061e2ceea5878a1bbd
Parents
105b6e8a

Changes

1 files changed · +1 −1

FileStatusAddDelContent
include/linux/flex_array.hmodified+1−1View file

include/linux/flex_array.h

View file
diff --git a/include/linux/flex_array.h b/include/linux/flex_array.h
index 23c1ec7..603160d 100644
--- a/include/linux/flex_array.h
+++ b/include/linux/flex_array.h
@@ -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