A question about sizeof

Doug Gwyn gwyn at smoke.BRL.MIL
Wed Oct 24 05:48:37 AEST 1990


In article <ERU.90Oct22103249 at tnvsu1.tele.nokia.fi> eru at tnvsu1.tele.nokia.fi (Erkki Ruohtula) writes:
>What should "sizeof (struct_pointer->field_of_array_type)" be?
>Do the parentheses affect the interpretation?
>There is a compiler that gives the pointer size in the last example, and I am
>wondering, whether or not this is a bug.

Yes, at least it's not standard conforming.  Section 3.3.1 says that
the type and value of a parenthesized expression are identical to those
of the unparenthesized expression.  The three paragraphs in 3.2.2.1
concerning type conversion in certain contexts clearly could not apply,
as is particularly evident for a parenthesized lvalue, without
contradicting 3.3.1.  Since this is a case where naive reading of the
standard could produce a contradiction, feel free to send in an official
request to X3 for an interpretation ruling on this point.



More information about the Comp.std.c mailing list