home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!rpi!utcsri!dgp.toronto.edu!flaps
- Newsgroups: comp.std.c
- From: flaps@dgp.toronto.edu (Alan J Rosenthal)
- Subject: Re: Struct hack one last time (one last time)
- Message-ID: <1993Jan7.145117.8220@jarvis.csri.toronto.edu>
- References: <1992Dec31.153931.7495@hubcap.clemson.edu> <1993Jan1.173852.26630@taumet.com>
- Date: 7 Jan 93 19:51:17 GMT
- Lines: 11
-
- steve@taumet.com (Steve Clamage) writes:
- >An implementation is allowed to add padding to the end of a struct.
- >Suppose that the implementation adds space to the end of each struct
- >type where it encodes information used for run-time error checking.
-
- Can't do that... what happens when you malloc one of them?
-
- struct whatever *p = (struct whatever *)malloc(sizeof(struct whatever));
-
- Immediately after the malloc, if p is not null you can start using the struct,
- but it won't have that run-time-error-checking information, so it will fault.
-