Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!iuvax!ux1.cso.uiuc.edu!ux1.cso.uiuc.edu!uicsrd.csrd.uiuc.edu!davies From: davies@uicsrd.csrd.uiuc.edu Newsgroups: comp.lang.c Subject: Re: sizeof a struc field Message-ID: <44200027@uicsrd.csrd.uiuc.edu> Date: 12 Oct 89 21:16:00 GMT References: <7710@microsoft.UUCP> Lines: 17 Nf-ID: #R:microsoft.UUCP:7710:uicsrd.csrd.uiuc.edu:44200027:000:691 Nf-From: uicsrd.csrd.uiuc.edu!davies Oct 12 16:16:00 1989 gwyn@smoke.BRL.MIL writes re: using sizeof((type *)0->field: ** **No, there IS no type information, because the construct is **officially meaningless. You THINK you know what type was MEANT, **but the compiler is not obliged to mimic your thought processes. ** **This is not an issue about sizeof, but rather about ->. If it is "officially meaningless" to use (type *)0->field, would it be "officially meaningful" to instead substitute (type *)1->field? After all, the pointer is no longer NULL, so it must be ok, right? This whole discussion seems a bit abstract - can anybody cite references from the standard or examples of compiler behaviour when confronted with something like this?