Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!uunet!munnari.oz.au!cs.mu.oz.au!ok From: ok@cs.mu.oz.au (Richard O'Keefe) Newsgroups: comp.lang.c Subject: Re: sizeof a struc field Message-ID: <2488@munnari.oz.au> Date: 21 Oct 89 10:04:28 GMT References: <7710@microsoft.UUCP> <11316@smoke.BRL.MIL> <7685@cdis-1.uucp> Sender: news@cs.mu.oz.au Lines: 10 In article <7685@cdis-1.uucp>, tanner@cdis-1.uucp (Dr. T. Andrews) writes: > What we have not heard is a convincing explanation of why the cited > construct should be considered harmful. No excuse for an > implementation that might blow up on it has been given. Further, > no useful alternative has (to date) shown up. I'm sure I'll be corrected if I'm wrong, but isn't the actual restriction that the argument of "sizeof" must be an L-value in ANSI C? If I'm right about that, then the problem is not that sizeof ((struct foo*)NULL)->field may "blow up", but that ((struct foo*)NULL)->field is not an L-value.