Help me cast this!

Doug Gwyn gwyn at brl-smoke.ARPA
Wed May 4 00:06:18 AEST 1988


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.  The best you can do is obtain a "possible pointer alignment problem"
warning.  That's because "lint" does not know that the pointer returned by
malloc() is guaranteed to point to properly aligned storage for any use.



More information about the Comp.lang.c mailing list