🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #3340

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

#3340
From: Dave Eisen
Date: Thu, 07 Jan 1993 22:12
27 lines
1666 bytes
Deleting most of the back and forth here, you know where to
find it if you need it.

>|> >>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.

>How should the poor compiler know WHERE to insert that information.  For malloc
>there might be special handling in the compiler, but consider a library
>memory-allocation routine of my own that returns void * and which does not
>impose a simple relationship between arguments and the size of the
>chunk of memory allocated!

This has nothing to do with malloc. The hypothetical compiler
could simply insert this error checking information whenever
it does a conversion from a (void *) to a (struct foo *). Again,
the basic question is still unresolved here: can a conversion
from one pointer type to another affect bytes other than those
where the pointer variable is stored?


-- 
Dave Eisen                               Sequoia Peripherals: (415) 967-5644
dkeisen@leland.Stanford.EDU              Home:                (415) 321-5154
       There's something in my library to offend everybody. 
          --- Washington Coalition Against Censorship
Technical Details
Message-ID: <1993Jan7.221207.13818@leland.Stanford.EDU>
Path: arc1-ca.pugleaf.net!sparky!uunet!stanford.edu!nntp.Stanford.EDU!dkeisen

Show Full Headers
Complete Article Headers
Newsgroups: comp.std.c
Path: arc1-ca.pugleaf.net!sparky!uunet!stanford.edu!nntp.Stanford.EDU!dkeisen
From: dkeisen@leland.Stanford.EDU (Dave Eisen)
Subject: Re: Struct hack one last time (one last time)
Message-ID: <1993Jan7.221207.13818@leland.Stanford.EDU>
Sender: news@leland.Stanford.EDU (Mr News)
Organization: Sequoia Peripherals, Inc.
Date: Thu, 7 Jan 93 22:12:07 GMT
Lines: 27