🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.amiga.tech
Article #5536

Re: malloc under Lattice C V5.05

#5536
From: Peter da Silva
Date: Sun, 30 Sep 1990 13:00
22 lines
1849 bytes
> In article <6620@sugar.hackercorp.com> peter@sugar.hackercorp.com (Peter da Silva) writes:
> >(As an aside: most 68000 compilers I've used in the past have returned
> > pointers in A0 and ints in D0. Seems like an obvious move. I guess Manx
> > and Lattice had other priorities.)

In article <dillon.6198@overload.Berkeley.CA.US> dillon@overload.Berkeley.CA.US (Matthew Dillon) writes:
>     This type of 'buggy' program is such an obscure bug that I fault the
>     compilers for trying to do the A0/D0 business without adding
>     appropriate cautions.

Why? Any program that fails on this sort of compiler will also fail on any
compiler where sizeof(int) != sizeof(char *) (like Aztec C on the Amiga
in default mode prior to 5.0, or any IBM-PC compiler with reasonably large
programs). Far from being an obscure bug, it's by far the most common one in
BSD/VAX originated software.

If you want to play games with the name, why not put the *whole* prototype
into the name? (frex, if you have (void *)malloc(unsigned), make the real name
of the routine vp$malloc$u)
-- 
Peter da Silva.   `-_-'
<peter@sugar.hackercorp.com>.
Technical Details
Message-ID: <6663@sugar.hackercorp.com>
Path: arc1-ca.pugleaf.net!utzoo!attcan!utgpu!news-server.csri.toronto.edu!rutgers!uwm.edu!wuarchive!rex!samsung!sol.ctr.columbia.edu!emory!mephisto!ncar!zaphod.mps.ohio-state.edu!lavaca.uh.edu!menudo.uh.edu!sugar!peter
References: <3034@orbit.cts.com> <V%$%LR_@rpi.edu> <1990Sep23.061925.6887@jato.jpl.nasa.gov> <6620@sugar.hackercorp.com> <13660@mcdphx.phx.mcd.mot.com> <dillon.6198@overload.Berkeley.CA.US>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!utgpu!news-server.csri.toronto.edu!rutgers!uwm.edu!wuarchive!rex!samsung!sol.ctr.columbia.edu!emory!mephisto!ncar!zaphod.mps.ohio-state.edu!lavaca.uh.edu!menudo.uh.edu!sugar!peter
From: peter@sugar.hackercorp.com (Peter da Silva)
Newsgroups: comp.sys.amiga.tech
Subject: Re:  malloc under Lattice C V5.05
Message-ID: <6663@sugar.hackercorp.com>
Date: 30 Sep 90 13:00:45 GMT
References: <3034@orbit.cts.com> <V%$%LR_@rpi.edu> <1990Sep23.061925.6887@jato.jpl.nasa.gov> <6620@sugar.hackercorp.com> <13660@mcdphx.phx.mcd.mot.com> <dillon.6198@overload.Berkeley.CA.US>
Reply-To: peter@sugar.hackercorp.com (Peter da Silva)
Organization: Sugar Land Unix - Houston
Lines: 22