Re: [cc65] Compiler code generation bug?

From: Oliver Schmidt <ol.sc1web.de>
Date: 2013-03-08 13:45:36
Hi Dave,

Insights welcomed!
>

Maybe I'm misunderstadning something and my comment isn't relevant but it
seems to me that you might not take 'integer promotions' into account:

"Integer types smaller than int are promoted when an operation is performed
on them. If all values of the original type can be represented as an int,
the value of the smaller type is converted to an int; otherwise, it is
converted to an unsigned int. Integer promotions are applied as part of the
usual arithmetic conversions to certain argument expressions; operands of
the unary +, -, and ~ operators; and operands of the shift operators."

From:
https://www.securecoding.cert.org/confluence/display/seccode/INT02-C.+Understand+integer+conversion+rules

Regards,
Oliver

----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo@musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Fri Mar 8 13:45:44 2013

This archive was generated by hypermail 2.1.8 : 2013-03-08 13:45:48 CET