Article View: comp.std.c
Article #5846Re: Constant expressions in initializers
From: Doug Gwyn
Date: Thu, 30 Mar 1989 17:06
Date: Thu, 30 Mar 1989 17:06
9 lines
995 bytes
995 bytes
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.
Technical Details
Message-ID:
<9955@smoke.BRL.MIL>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!bloom-beacon!bu-cs!purdue!haven!adm!smoke!gwynReferences:
<5716@cognos.UUCP>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!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) <gwyn>) Organization: Ballistic Research Lab (BRL), APG, MD. Lines: 9