This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: .size directives and flexible array members
- From: Ian Lance Taylor <iant at google dot com>
- To: "Marcin 'Qrczak' Kowalczyk" <qrczak at knm dot org dot pl>
- Cc: gcc at gcc dot gnu dot org
- Date: 27 Aug 2006 10:17:24 -0700
- Subject: Re: .size directives and flexible array members
- References: <87r6z2w4bu.fsf@qrnik.zagroda>
"Marcin 'Qrczak' Kowalczyk" <qrczak@knm.org.pl> writes:
> gcc-4.1.0-0.20051206r108118 emits wrong .size directives for
> statically initialized objects with a flexible array member,
> e.g.:
>
> struct {int x; int y[];} obj = {1, {2, 3}};
>
> .globl obj
> .data
> .align 4
> .type obj, @object
> .size obj, 4
> obj:
> .long 1
> .long 2
> .long 3
>
> Can this have serious effects (like overlapped or split objects),
> or is .size used only for e.g. debugging?
In general .size is only used for debugging purposes. Certainly the
compiler and assembler do not use the information for anything.
Still, this looks like a bug which should be fixed. If there is not
already a bug report on this, please file one. See
http://gcc.gnu.org/bugs.html. Thanks.
Ian