Help me cast this!

John F. Haugh II jfh at rpp386.UUCP
Fri May 6 14:11:39 AEST 1988


In article <7822 at brl-smoke.ARPA> gwyn at brl.arpa (Doug Gwyn (VLD/VMB) <gwyn>) writes:
>In article <294 at fedeva.UUCP> wrd3156 at 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 at rpp386               | every step up ..." -- Rainer Maria Rilke



More information about the Comp.lang.c mailing list