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

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

Re: [avr-gcc-list] Re: Why is gcc promoting on an unsigned char?


From: Neil Johnson
Subject: Re: [avr-gcc-list] Re: Why is gcc promoting on an unsigned char?
Date: Tue, 23 Dec 2003 17:18:23 +0000 (GMT)

Hi,

Of course, it could just be a bug in the GCC optimizer...

Having tracked through the C standard a little bit it does look like an
oversight: the type of the conditional expression should be unsigned char,
which together with the unsigned-char'ness of "data" the compiler should
spot the types in the bitwise OR as "unsigned char OR unsigned char".

BTW, I *hate* ?: operator, version 1 --- using a side-effect in a
conditional expression.  Yuck :-(  At least with the if..then version it
is very obvious what your intention is.

Cheers,
Neil

--
Neil Johnson :: Computer Laboratory :: University of Cambridge ::
http://www.njohnson.co.uk          http://www.cl.cam.ac.uk/~nej22
----  IEE Cambridge Branch: http://www.iee-cambridge.org.uk  ----


reply via email to

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