Newsgroups: comp.sys.amiga.tech
Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!ames!haven!decuac!e2big.mko.dec.com!bacchus.pa.dec.com!decwrl!sdd.hp.com!zaphod.mps.ohio-state.edu!rpi!ceej
From: ceej@pawl.rpi.edu (Chris J Hillery)
Subject: Re: malloc under Lattice C V5.05
Message-ID: <V%$%LR_@rpi.edu>
Organization: Rensselaer Polytechnic Institute, Troy NY
References: <3034@orbit.cts.com>
Date: 12 Aug 90 17:58:45 GMT
Lines: 28

bga@pnet51.orb.mn.org (Bruce Albrecht) writes:

>I had defined the following fragment:
>  char *outname;
> 
>  outname = malloc(SomeConstant);

>the compiler gave me a warning that the malloc was not the same type as
>outname, and I had to change it to (char *) malloc to get rid of the warning.
>Am I misunderstanding something, or is the errata sheet wrong, or is there
>something wrong with Lattice C (either in the include or compiler)?

Here's a (sort of) related question:  does it even matter if it gives you
a warning like this? Most cases when I get these warnings (type mismatch)
are either <a>my own dumb fault, which usually will crash if left in the
code, or <b>unimportant or outright intentional type mismatching (ie, 
automatic type conversions for code efficiency). These programs have always
seemed to work right, even when I was given the warning (well, assuming it/
they were the ONLY warnings/errors, of course); am I missing something?
Is my code less effcient or corrupt or something if I leave these?
>UUCP: {amdahl!bungia, uunet!rosevax, crash}!orbit!pnet51!bga
>ARPA: crash!orbit!pnet51!bga@nosc.mil
>INET: bga@pnet51.orb.mn.org
-- 
  //..is|While 1 DO|Erin,Erin,where are|Art of Noise space|    -- Ceej    (=
\X/there|  Fork;   |you? /-----------.-^------------------|ceej@pawl.rpi.edu
AMIGAany|----------^-----|Cebhq gb or|Reclaimer:Hey!That's| gmry@mts.rpi.edu
(=other?|HOW DO YOU FEEL.|Yvoreny! (=|mine! Bring it back!|aka Chris Hillery
