Sujet : Re: Computer architects leaving Intel...
De : tkoenig (at) *nospam* netcologne.de (Thomas Koenig)
Groupes : comp.archDate : 14. Sep 2024, 21:00:35
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vc4mgj$1khmk$1@dont-email.me>
References : 1 2 3 4 5
User-Agent : slrn/1.0.3 (Linux)
Kent Dickey <
kegs@provalid.com> schrieb:
When you write code working on signed numbers and do something like:
>
(a < 0) || (a >= max)
>
Then the compiler realizes if you treat 'a' as unsigned, this is just:
>
(unsigned)a >= max
For which definition of a and max exactly?
It coertainly does not do so for
_Bool foo(int a, int max)
{
return (a < 0) || (a >= max);
}