Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!wuarchive!brutus.cs.uiuc.edu!lll-winken!ubvax!ardent!jra!jss From: jss@jra.ardent.com (Jerry Schwarz (Compiler)) Newsgroups: comp.lang.c Subject: Re: sizeof a struc field Message-ID: <8361@ardent.UUCP> Date: 20 Sep 89 16:29:26 GMT References: <7710@microsoft.UUCP> <11086@smoke.BRL.MIL> <131@dtoa3.dt.navy.mil> <11110@smoke.BRL.MIL> Sender: news@ardent.UUCP Reply-To: jss@jra.ardent.com (Jerry Schwarz (Compiler)) Organization: Ardent Computer Corp., Sunnyvale, CA Lines: 20 In article <11110@smoke.BRL.MIL> gwyn@brl.arpa (Doug Gwyn) writes: With regard to a discussion of: sizeof(((struct abc *)0)->ghi) > >Is the type of an illegal expression well defined? >Perhaps it's the same as the type of one hand clapping. Which suggests that Doug believes that this is an illegal expression. But is it? It (the operand of sizeof) is an expression whose evaluation would result in undefined behavior, but does that make it illegal? I think not, and here it is used in a context where it explicitly will not be evaluated. I believe the above is a legal expression. Jerry Schwarz jss@ardent.com