lint on malloc calls

Doug Gwyn gwyn at smoke.ARPA
Fri Sep 9 20:05:50 AEST 1988


In article <39617 at linus.UUCP> jgb at linus.UUCP (Jonathan G. Bressel) writes:
>	nextentry = (entry *) malloc(sizeof(entry));

That's correct.

>	phone.c(61): warning: illegal pointer combination
>	phone.c(61): warning: possible pointer alignment problem

"lint" doesn't know that malloc() always returns a suitably-aligned pointer.
There really isn't any way to prevent these warnings (other than changing
the code that "lint" sees).



More information about the Comp.lang.c mailing list