Remove some warnings
Kaveh R. Ghazi
ghazi@caip.rutgers.edu
Fri Jan 12 14:38:00 GMT 2001
> From: Andreas Jaeger <aj@suse.de>
>
> >>>>> Bernd Schmidt writes:
>
> > On 12 Jan 2001, Andreas Jaeger wrote:
> >> > Isn't it possible for sizeof to return a signed type on some
> >> > hosts? Maybe this is better fixed with casts in the for
> >> > statements?
> >>
> >> It is possible - but ISO C99 demands size_t as result.
>
> > Maybe i should be declared as size_t then. (I know this sort of
> > thing was discussed once, I just have forgotten what the
> > conclusion was :-)
>
> I don't remember either. But with size_t being 64 bits on a 64 bit
> platform, I prefer an int that's in general 32 bits (or is this a
> disadvantage) - we're discussing the loop variable here.
>
> Andreas
If the warning if coming from comparison against a sizeof, (which has
a type of size_t) then the loop variable should IMHO be a size_t also.
That's the convention I've been following.
--Kaveh
--
Kaveh R. Ghazi Engagement Manager / Project Services
ghazi@caip.rutgers.edu Qwest Internet Solutions
More information about the Gcc-patches
mailing list