avr-gcc-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-gcc-list] Byte values promted to int when during compare


From: hanzl
Subject: Re: [avr-gcc-list] Byte values promted to int when during compare
Date: Thu, 24 Jun 2004 18:15:27 +0200

>>> unsigned char A,B; ... A & 15 != B ...

>>  It seems that A is promoted to int before the binary & operation ?
>>  But why?
>
> Because the C standard says so.

And because the compiler was not clever enough (or was not instructed
to do so?) to optimize this back to byte-only operations?

It seems to me that in many practical cases (like the one above) we
can have both strict ISO and quick code through clever enough
optimization.

Or maybe we already have it? Somebody knows?

Regards

Vaclav Hanzl




reply via email to

[Prev in Thread] Current Thread [Next in Thread]