diff options
author | wcohen <wcohen@138bc75d-0d04-0410-961f-82ee72b054a4> | 2000-10-04 18:03:33 +0000 |
---|---|---|
committer | wcohen <wcohen@138bc75d-0d04-0410-961f-82ee72b054a4> | 2000-10-04 18:03:33 +0000 |
commit | eae914e28dc4509a3eac92c0cfb3d877673ba678 (patch) | |
tree | 50adc28a80efb5aff96a5d508de8bc7cc9824c02 /gcc/c-typeck.c | |
parent | c884589e4b8d04bf3f1fb587445bbbeca1f70d58 (diff) | |
download | ppe42-gcc-eae914e28dc4509a3eac92c0cfb3d877673ba678.tar.gz ppe42-gcc-eae914e28dc4509a3eac92c0cfb3d877673ba678.zip |
Patched code to generate warning when trying to perform static
initialization of zero-length arrays.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@36714 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c-typeck.c')
-rw-r--r-- | gcc/c-typeck.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/c-typeck.c b/gcc/c-typeck.c index da8ced243b8..9f2ec8d1e78 100644 --- a/gcc/c-typeck.c +++ b/gcc/c-typeck.c @@ -6460,7 +6460,8 @@ process_init_element (value) } if (constructor_max_index != 0 - && tree_int_cst_lt (constructor_max_index, constructor_index)) + && (tree_int_cst_lt (constructor_max_index, constructor_index) + || integer_all_onesp (constructor_max_index))) { pedwarn_init ("excess elements in array initializer"); break; |