On 06/15/11 08:17, Jim Meyering wrote:
> + vasnprintf: avoid a warning from gcc -Wsign-compare
> + * lib/vasnprintf.c (VASNPRINTF): Cast a known-positive quantity to
> + size_t in order to avoid a warning from gcc -Wsign-compare.
Given that the context is this:
if (count >= 0)
{
/* Verify that snprintf() has NUL-terminated its
result. */
if (count < maxlen
&& ((TCHAR_T *) (result + length)) [count] != '\0')
abort ();
wouldn't it be better to send the GCC maintainers a bug report?
Since maxlen is unsigned, and since it is obvious to
the compiler that count is nonnegative, there is no reason for
a sign-compare warning here.