[Top][All Lists]
[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 ----
- [avr-gcc-list] Re: avr-gcc-list Digest, Vol 11, Issue 19, Ewout Boks, 2003/12/22
- [avr-gcc-list] Why is gcc promoting on an unsigned char?, J.C. Wren, 2003/12/23
- [avr-gcc-list] Re: Why is gcc promoting on an unsigned char?, J.C. Wren, 2003/12/23
- RE: [avr-gcc-list] Re: Why is gcc promoting on an unsigned char?, Rune Christensen, 2003/12/23
- Re: [avr-gcc-list] Re: Why is gcc promoting on an unsigned char?, J.C. Wren, 2003/12/23
- Re: [avr-gcc-list] Re: Why is gcc promoting on an unsigned char?, Jörgen Birkler, 2003/12/23
- Re: [avr-gcc-list] Re: Why is gcc promoting on an unsigned char?, Neil Johnson, 2003/12/23
- Re: [avr-gcc-list] Re: Why is gcc promoting on an unsigned char?, J.C. Wren, 2003/12/23
- Re: [avr-gcc-list] Re: Why is gcc promoting on an unsigned char?,
Neil Johnson <=
- Re: [avr-gcc-list] Re: Why is gcc promoting on an unsigned char?, J.C. Wren, 2003/12/23
- Re: [avr-gcc-list] Re: Why is gcc promoting on an unsigned char?, David Gay, 2003/12/23
- Re: [avr-gcc-list] Re: Why is gcc promoting on an unsigned char?, J.C. Wren, 2003/12/23