Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ncar!tank!ux1.cso.uiuc.edu!ux1.cso.uiuc.edu!uxe.cso.uiuc.edu!mcdonald From: mcdonald@uxe.cso.uiuc.edu Newsgroups: comp.lang.c Subject: Re: sizeof a struc field Message-ID: <225800231@uxe.cso.uiuc.edu> Date: 27 Oct 89 15:42:00 GMT References: <7710@microsoft.UUCP> Lines: 22 Nf-ID: #R:microsoft.UUCP:7710:uxe.cso.uiuc.edu:225800231:000:532 Nf-From: uxe.cso.uiuc.edu!mcdonald Oct 27 10:42:00 1989 >However, the argument is persuasive only because the constant 0 has a >special meaning in C. We know a null pointer does not point to an >object. But what happens if we do the following? > sizeof ((type *)1)->member How about /* suitable definition of type and member here */ void *a; size_t b = sizeof(((type *)a)->member); type *c; a = malloc(b); c = (type * )a; Somehow this begins to look awfully legal to me. What if the malloc was in another source file that was not linked in? Doug McDonald