This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: warning: assignment makes pointer from integer without a cast


"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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]