[Bug c/39383] sizeof object with zero-length array ignores initializer

2009-04-23 Thread anmol at freescale dot com
--- Comment #11 from anmol at freescale dot com 2009-04-23 15:53 --- Fix (for generic ELF systems) and test program for regression suite posted here: http://gcc.gnu.org/ml/gcc-patches/2009-04/msg01807.html -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39383

[Bug c/39383] sizeof object with zero-length array ignores initializer

2009-04-17 Thread anmol at freescale dot com
--- Comment #10 from anmol at freescale dot com 2009-04-17 22:39 --- I am working on this problem and see that for generic ELF OS's, defining ASM_DECLARE_OBJECT_NAME (gcc/config/elfos.h) to use the size of the initializer (as against the size of the type) to emit the true size in the .si

[Bug c/39383] sizeof object with zero-length array ignores initializer

2009-04-08 Thread joseph at codesourcery dot com
--- Comment #9 from joseph at codesourcery dot com 2009-04-08 22:54 --- Subject: Re: sizeof object with zero-length array ignores initializer On Wed, 8 Apr 2009, b07584 at freescale dot com wrote: > --- Comment #8 from b07584 at freescale dot com 2009-04-08 21:36 --- > > Sta

[Bug c/39383] sizeof object with zero-length array ignores initializer

2009-04-08 Thread b07584 at freescale dot com
--- Comment #8 from b07584 at freescale dot com 2009-04-08 21:36 --- > Standard C does not permit initializing the flexible array member. > However, (using revision 145360) with -std=c99, the given code compiles - no error is issued. -- b07584 at freescale dot com changed:

[Bug c/39383] sizeof object with zero-length array ignores initializer

2009-03-06 Thread jsm28 at gcc dot gnu dot org
--- Comment #7 from jsm28 at gcc dot gnu dot org 2009-03-06 17:27 --- Reopening. -- jsm28 at gcc dot gnu dot org changed: What|Removed |Added Status|RESOLVED

[Bug c/39383] sizeof object with zero-length array ignores initializer

2009-03-06 Thread algrant at acm dot org
--- Comment #6 from algrant at acm dot org 2009-03-06 14:44 --- Right. The existence of a statically initialized object whose size can be determined at compile-time to be larger than the (notional) type size, is specific to GCC. Here's another thing: the assembler output shows

[Bug c/39383] sizeof object with zero-length array ignores initializer

2009-03-05 Thread algrant at acm dot org
--- Comment #5 from algrant at acm dot org 2009-03-05 14:48 --- *** Bug 39384 has been marked as a duplicate of this bug. *** -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39383

[Bug c/39383] sizeof object with zero-length array ignores initializer

2009-03-05 Thread joseph at codesourcery dot com
--- Comment #4 from joseph at codesourcery dot com 2009-03-05 13:53 --- Subject: Re: sizeof object with zero-length array ignores initializer On Thu, 5 Mar 2009, ebotcazou at gcc dot gnu dot org wrote: > --- Comment #3 from ebotcazou at gcc dot gnu dot org 2009-03-05 13:31 > --

[Bug c/39383] sizeof object with zero-length array ignores initializer

2009-03-05 Thread ebotcazou at gcc dot gnu dot org
--- Comment #3 from ebotcazou at gcc dot gnu dot org 2009-03-05 13:31 --- > No, the case is an extension to C. 6.5.3.4 was obviously written without this > case in mind. Not at all, see 6.7.2.1 (16): 16 As a special case, the last element of a structure with more than one named membe

[Bug c/39383] sizeof object with zero-length array ignores initializer

2009-03-05 Thread algrant at acm dot org
--- Comment #2 from algrant at acm dot org 2009-03-05 13:19 --- No, the case is an extension to C. 6.5.3.4 was obviously written without this case in mind. In this case "the size... of its operand" cannot be "determined from the type". Either sizeof doesn't return the (real) size of t

[Bug c/39383] sizeof object with zero-length array ignores initializer

2009-03-05 Thread ebotcazou at gcc dot gnu dot org
--- Comment #1 from ebotcazou at gcc dot gnu dot org 2009-03-05 13:06 --- > Currently sizeof(f1) == sizeof(int) rather than 4*sizeof(int), i.e. > sizeof the object is determined by the type only, not the actual object > size taking into account its initializer. That's C. 6.5.3.4 (2) r