piclist 2008\07\09\132243a >
Thread: Code packing
www.piclist.com/techref/index.htm?key=code+packing
flavicon
face BY : Herbert Graf email (remove spam text)



On Wed, 2008-07-09 at 18:03 +0100, Alan B. Pearce wrote:
> >1) PORTA is an unsigned char. Therefore, before we can take
> >its complement, it must be promoted to signed int.
>
> What a load of rubbish. There is no 'must be promoted' at all. There is no
> reason to promote an unsigned char to signed int.

FWIW most of this thread has been mostly over my head (never took a
course on compiler design, always been more into the hardware...).

That said, I am interested in the "integer promotion". What ARE the
rules for promotion? I have been hit a couple times with promotion
happening when I didn't think it would, and other times not happening
when I thought it should have.

What are common "gotchas" with regards to type promotion?

Since I'm not that familiar with the rules, I generally explicitly cast
so that I don't have to worry about them, but now I'm curious! :)

TTYL

<1215624161.26513.45.camel@E2140> 7bit

In reply to: <0d8001c8e1e5$bbf73580$1979f682@space.rl.ac.uk>
See also: www.piclist.com/techref/index.htm?key=code+packing
Reply You must be a member of the piclist mailing list (not only a www.piclist.com member) to post to the piclist. This form requires JavaScript and a browser/email client that can handle form mailto: posts.
Subject (change) Code packing

month overview.

new search...