🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #3336

Re: Struct hack one last time (one last time)

#3336
From: Alan J Rosenthal
Date: Thu, 07 Jan 1993 19:51
11 lines
953 bytes
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.
Technical Details
Message-ID: <1993Jan7.145117.8220@jarvis.csri.toronto.edu>
Path: arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!rpi!utcsri!dgp.toronto.edu!flaps
References: <1992Dec31.153931.7495@hubcap.clemson.edu> <1993Jan1.173852.26630@taumet.com>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!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