Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!bloom-beacon!bu-cs!purdue!haven!adm!smoke!gwyn From: gwyn@smoke.BRL.MIL (Doug Gwyn ) Newsgroups: comp.std.c Subject: Re: Constant expressions in initializers Message-ID: <9955@smoke.BRL.MIL> Date: 30 Mar 89 17:06:48 GMT References: <5716@cognos.UUCP> Reply-To: gwyn@brl.arpa (Doug Gwyn (VLD/VMB) ) Organization: Ballistic Research Lab (BRL), APG, MD. Lines: 9 In article <5716@cognos.UUCP> brunog@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.