This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
Other format: | [Raw text] |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56078 Jakub Jelinek <jakub at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jsm28 at gcc dot gnu.org --- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> 2013-01-23 14:23:30 UTC --- Note, the code is not valid ISO C99, which forbids initialization of flexible array members, but a GNU extension, apparently not sufficiently well defined. E.g. in struct T t2 = { .a = 1, .b[0] = 'a' }; the .b[0] initializer is ignored with a warning, only initializing it as whole, whether as in #c3 without that extra ", .b[0] = '2'", or e.g. as in struct T t3 = { .a = 1, .b = { [0] = 'a', [1] = 'b', [2] = 'c' } }; So the question is how exactly we want to handle the flexible array members vs. designated initializers, if we take the size from the first initializer and all further ones will be either ignored (if beyond that size) or overwrite the initializer, or if we e.g. take the highest array index ever seen anywhere. So, say, is struct T t4 = { .a = 1, .b[5] = '5', .b[7] = '7' }; the same as struct T t4 = { .a = 1, .b = { 0, 0, 0, 0, 0, '5' }; with warning or: struct T t4 = { .a = 1, .b = { 0, 0, 0, 0, 0, '5', 0, '7' }; ?
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |