This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: warning: assignment makes pointer from integer without a cast
- From: Ian Lance Taylor <iant at google dot com>
- To: "Manal Helal" <manalorama at gmail dot com>
- Cc: gcc-help at gcc dot gnu dot org
- Date: 27 Jan 2007 20:16:42 -0800
- Subject: Re: warning: assignment makes pointer from integer without a cast
- References: <131b56be0701271930j426b2f04s8249d5f27a6692a@mail.gmail.com>
"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