Path: utzoo!mnetor!uunet!husc6!mailrus!umix!umich!mibte!gamma!ulysses!thumper!faline!bellcore!tness7!ninja!pollux!dalsqnt!rpp386!jfh
From: jfh@rpp386.UUCP (John F. Haugh II)
Newsgroups: comp.lang.c
Subject: Re: Help me cast this!
Message-ID: <1543@rpp386.UUCP>
Date: 6 May 88 04:11:39 GMT
References: <294@fedeva.UUCP> <7822@brl-smoke.ARPA>
Reply-To: jfh@rpp386.UUCP (The Beach Bum)
Organization: Big "D" Home for Wayward Hackers
Lines: 28
Summary: try declaring malloc as returning void pointer.

In article <7822@brl-smoke.ARPA> gwyn@brl.arpa (Doug Gwyn (VLD/VMB) ) writes:
>In article <294@fedeva.UUCP> wrd3156@fedeva.UUCP (Bill Daniels) writes:
>>How do I cast the malloc() in line 12 of the following program to avoid 
>>the lint cries of "warning: illegal pointer combination" et al?
>
>General, SVR2 "lint" will complain about casting the (char *) returned
>by malloc() into other pointer types, and there seems to be no way around
>it.

my answer didn't make it out due to hardware trouble.  however, while
banging on the problem i tried solving the lint noise.  what i learned
was that if i declared

void	*malloc ();

then lint shut up.  this would seem to be the correct behavior for an
ANSI conforming lint.  i did get errors concerning the use of malloc,
but those could be corrected by properly declaring malloc (as above)
in llib-c.

well, karl, what you got to say???

- john.
-- 
John F. Haugh II                 | "You see, I want a lot.  Perhaps I want every
River Parishes Programming       | -thing.  The darkness that comes with every
UUCP:   ihnp4!killer!rpp386!jfh  | infinite fall and the shivering blaze of
DOMAIN: jfh@rpp386               | every step up ..." -- Rainer Maria Rilke