Path: csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!border3.nntp.dca.giganews.com!Xl.tags.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local2.nntp.dca.giganews.com!nntp.earthlink.com!news.earthlink.com.POSTED!not-for-mail NNTP-Posting-Date: Sat, 04 Jun 2011 11:55:08 -0500 Message-ID: <4DEA636F.7BF2@mindspring.com> Date: Sat, 04 Jun 2011 12:55:11 -0400 From: pete Reply-To: pfiland@mindspring.com Organization: PF X-Mailer: Mozilla 3.04Gold (WinNT; I) MIME-Version: 1.0 Newsgroups: comp.lang.c Subject: Re: offsetof() Macro Attempt References: <4DE92C83.824@mindspring.com> <4DEA0DB0.5BE6@mindspring.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Lines: 48 X-Usenet-Provider: http://www.giganews.com NNTP-Posting-Host: 4.154.223.96 X-Trace: sv3-Snzb0Te7600dNSsbBP0XZSlVif42zmyi8tUJLR9vdIPOF4CYBxvvvPbb3aOU9+e1elDhOHhV8BV7AOm!X2Qm6wbggODyxaddVUrV9gfzt/3+fDaY9+Xto1iD7UpAVCC87tiGXOZjg6LQnYTUHp8UhtMc+4J8!zD3ynDJhRw== X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.40 X-Original-Bytes: 2185 Xref: x330-a1.tempe.blueboxinc.net comp.lang.c:5436 Shao Miller wrote: > > On 6/4/2011 5:49 AM, pete wrote: > > Shao Miller wrote: > >> > >> On 6/3/2011 1:48 PM, pete wrote: > >>> Shao Miller wrote: > >>> > >>>> So let's please go on to: > >>>> > >>>> char ** helper; > >>>> > >>>> enum foo { > >>>> bar = *helper + 1 - *helper > >>>> }; > >>>> > >>>> int main(void) { > >>>> return 0; > >>>> } > > But even if (*helper) was defined, > > then (*helper + 1 - *helper) is still not a constant expression I should have said 'not an "integral constant expression"' > > and the compiler that I'm using, > > won't compile the above program. > > > > May I ask which compiler, please? Since I am concerned about > portability, that'd be great to know. Thanks! One of the ancient ones. Microsoft Developer Studio 97 VC++ 5.0 Compiling... new.c C:\Program Files\DevStudio\SharedIDE\bin\new.c(5) : error C2057: expected constant expression Error executing cl.exe. new.obj - 1 error(s), 0 warning(s) -- pete