Constant expressions in initializers

Doug Gwyn gwyn at smoke.BRL.MIL
Fri Mar 31 03:06:48 AEST 1989


In article <5716 at cognos.UUCP> brunog at cognos.UUCP (Bruno Godbout) writes:
>	I would like to know if this code is rejected by the ANSI
>definition or if it is only a restriction of the compiler I am using.

It looked okay to me.  This might make a good test case for compiler
validation.  So long as you invoke offsetof() correctly, which it
appears that you did, offsetof() is supposed to expand to an integral
constant expression, which is a subset of "arithmetic constant
expression", which is one of the allowed initializer classes.



More information about the Comp.std.c mailing list