prev up next   top/contents search

comp.lang.c FAQ list · Question 7.6

Q: Why am I getting ``warning: assignment of pointer from integer lacks a cast'' for calls to malloc?


A: Have you #included <stdlib.h>, or otherwise arranged for malloc to be declared properly? If not, the compiler assumes that it returns an int (see question 1.25), which is not correct. (The same problem could arise for calloc or realloc.) See also question 7.15.

References: H&S Sec. 4.7 p. 101


prev up next   contents search
about this FAQ list   about eskimo   search   feedback   copyright

Hosted by Eskimo North