vfprintf typing problem

Paul Eggert eggert@cs.ucla.edu
Fri Mar 30 14:55:00 GMT 2012


On 03/30/2012 01:18 AM, David Miller wrote:
> +    if (__builtin_expect ((unsigned int) INT_MAX - (unsigned int) done	      \
> +			  < (Len), 0))					      \

Since the values are all nonnegative there should be no need
to cast to unsigned int.  Could you please remove the casts?
They add confusion, since the reader is left wondering
why they're there at all.

> +	if (__builtin_expect ((unsigned int) width >= INT_MAX
> +			      / sizeof (CHAR_T) - 32, 0))

Likewise.

> -      if (__builtin_expect (width >= (size_t) -1 / sizeof (CHAR_T) - 32, 0))
> +      if (__builtin_expect ((unsigned int) width >= INT_MAX / sizeof (CHAR_T) - 32, 0))

Likewise.



More information about the Libc-alpha mailing list