Re: [IDEA+RFC] Possible solution for min()/max() war

Bernd Schmidt (bernds@redhat.com)
Fri, 31 Aug 2001 12:18:25 +0100 (BST)


On Thu, 30 Aug 2001, Richard B. Johnson wrote:
> #define MIN(a, b) ((unsigned int)(a) < (unsigned int)(b) ? (a) : (b))

> [root@blackhole /root]# sh -v xxx.sh
> #!/bin/bash
> cat >/tmp/xxx.c <<EOF
> gcc -Wall -Wsign-compare -c -o /dev/null /tmp/xxx.c
> /tmp/xxx.c: In function `main':
> /tmp/xxx.c:9: warning: signed and unsigned type in conditional expression
> rm -f /tmp/xxx.c
> gcc --version
> 2.96
>
> As you can see, the casts are !!!IGNORED!!! in gcc 2.96.

Nope. The warning refers to the use of a and b in the right-hand side of
the conditional. You have a type mismatch in the two arms of the
expression.

Bernd

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/