home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!dtix!darwin.sura.net!spool.mu.edu!yale.edu!ira.uka.de!Germany.EU.net!mikros!mwtech!martin
- From: martin@mwtech.UUCP (Martin Weitzel)
- Newsgroups: comp.std.c
- Subject: Re: Struct hack one last time (one last time)
- Message-ID: <1376@mwtech.UUCP>
- Date: 11 Jan 93 10:28:42 GMT
- References: <1992Dec31.153931.7495@hubcap.clemson.edu> <1993Jan1.173852.26630@taumet.com> <1993Jan7.145117.8220@jarvis.csri.toronto.edu> <1993Jan8.184304.10965@taumet.com>
- Reply-To: martin@mwtech.UUCP (Martin Weitzel)
- Organization: MIKROS Systemware, Darmstadt/W-Germany
- Lines: 21
-
- In article <1993Jan8.184304.10965@taumet.com> steve@taumet.com (Steve Clamage) writes:
- [...]
- :The compiler is allowed to recognize calls to standard library functions.
- :It could fix up the returned struct after the call to malloc (or realloc
- :or calloc). It would also have to interpret the size in case an array
- :were being allocated:
- : extern size_t s;
- : struct w *p = malloc(s);
- : /* fixup s/sizeof(struct w) structs here */
- :
- :You could subvert this via void* pointers, but that isn't the point.
- :Presumably this is an optional checkout mode, and such modes typically
- :impose constraints on programmers. If you play games to subvert type
- :checking, you are going to have problems.
-
- Wait, wait, I think this argument is not quite fair. I could proceed
- along the same path claiming a conforming program should not use setjmp/
- longjmp because I may envision some implementation which provides an
- optional checkout mode for programs that avoid setjmp, etc, etc.
- --
- Martin Weitzel, email: martin@mwtech.UUCP, voice: 49-(0)6151-6 56 83
-