Actually, both sum and ptr were initialized, I just did not show that
code.
int32_t romfs_checksum(int32_t *data, int size){
int32_t sum, *ptr;
sum = 0; ptr = data;
I now have my romfs mounting.
Thanks,
Garst
Chris Liechti wrote:
>
> Garst R. Reese wrote:
> > Beware,
> > mmc.c:39: warning: operation on `ptr' may be undefined
> > is emmitted with the following code.
> > int32_t sum, ptr;
> > sum += bswap_32(*ptr++);
>
> well you never init ptr, thus the warning.
> add:
> ptr = 0;
> or most likely something other than zero...
>
> and without "sum = 0" at the beginning you'll probably never be happy
> with the result ;-)
>
> note: local vars are not initialized, unlike globals. you have to
> explictly assign a value.
>
> chris
>
> -------------------------------------------------------
> SF.Net is sponsored by: Speed Start Your Linux Apps Now.
> Build and deploy apps & Web services for Linux with
> a free DVD software kit from IBM. Click Now!
> http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click
> _______________________________________________
> Mspgcc-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/mspgcc-users