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]

[Bug c/15240] sizeof() doesn't work on struct fields


------- 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]