This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/15240] sizeof() doesn't work on struct fields
- From: "d dot yu dot bolkhovityanov at inp dot nsk dot su" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 2 May 2004 07:39:56 -0000
- Subject: [Bug c/15240] sizeof() doesn't work on struct fields
- References: <20040501113223.15240.d.yu.bolkhovityanov@inp.nsk.su>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From d dot yu dot bolkhovityanov at inp dot nsk dot su 2004-05-02 07:39 -------
> > and it's the C standard which is in fault, right?
>
> No.
Andreas, sorry for taking your time, but can you please point me to some C
standard docs (discussion?) stating WHY such a reasonable behaviour is not allowed?
(The only constraint in the C99 standard (6.5.3.4) is "The sizeof operator shall
not be applied to an expression that has function type or an incomplete type, to
the parenthesized name of such a type, or to an expression that designates a
bit-field member." But "struct_type_name.field_name" falls outside of that
constraint.)
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15240