From: Andrew Lunn
> > -   while (arg_num < ctx->argc) {
> > +   while (arg_num < (unsigned int)ctx->argc) {
> 
> Did you try changing ctx->argc to an unsigned int? I guess there would
> be less casts that way, and it is a more logical type for this.

My favourite solution is to use '+ 0u' to force the signed
integer to unsigned.
Less likely to hide another bug than the cast.

But changing the type is better.
I just wish they'd fix gcc so that it didn't complain
if you'd just done a test that excluded negative values.

        David

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, 
UK
Registration No: 1397386 (Wales)

Reply via email to