warning: assignment makes pointer from integer without a cast

Ian Lance Taylor iant@google.com
Sun Jan 28 04:17:00 GMT 2007


"Manal Helal" <manalorama@gmail.com> writes:

> I am doing a realloc as follows:
> 
> structArray[i].innerarray = realloc (structArray[i].innerarray,
> structArray[i].innerarraySize * sizeof *(structArray[i].innerarray));
> 
> where I am changing the size of the inner array (defined as (int *)in
> the structure array, to the new size structArray[i].innerarraySize,
> and it is giving me:
> 
> warning: assignment makes pointer from integer without a cast

Did you #include <stdlib.h>?  When you use -Wall, do you see a warning
about calling realloc with no declaration?

Ian



More information about the Gcc-help mailing list