Re: [PATCH] Handle flexible arrays in builtin-object-size

2011-05-19 Thread H.J. Lu
On Thu, May 19, 2011 at 3:44 AM, Richard Guenther wrote: > > This patch makes us deal with flexible array members and global > initializers correctly, thus for > > struct s { >    int i; >    char c[]; > } s = { 1, "01234" }; > > return 6 for the size of s.c instead of 0 (which is wrong, it > shou

[PATCH] Handle flexible arrays in builtin-object-size

2011-05-19 Thread Richard Guenther
This patch makes us deal with flexible array members and global initializers correctly, thus for struct s { int i; char c[]; } s = { 1, "01234" }; return 6 for the size of s.c instead of 0 (which is wrong, it should have been reported as -1 instead - I didn't try to fix that particular i