Re[2]: [cc65] bug?

Date view Thread view Subject view

From: groepaz (groepaz_at_gmx.net)
Date: 2002-03-15 15:07:41


Hello Ullrich,

Friday, March 15, 2002, 2:56:39 PM, you wrote:

UvB> The C standard says that the binary minus operator has a higher precedence
UvB> than the shift operator, so both expressions must evaluate identical, which in
UvB> turn means that cc65 is doing the right thing. I cannot really believe that
UvB> gcc has a problem in this area, because this is quite a basic thing, and gcc
UvB> has a lot more users than cc65 (so the chance of a bug being detected is much
UvB> higher than with cc65).

oh didnt know that, i though >> binds even stronger than * ... mmh now
where did i get that from? ;=P

UvB> Maybe something else is wrong with your code? Two ideas that come to mind:

UvB>   * Signedness problems: If any one of the variables used in the expression is
UvB>     actually a character, your code may behave strange on some platforms for
UvB>     values > 127, because characters may be signed data types. As a rule of
UvB>     thumb, you should always specify your characters as "signed" or
UvB>     "unsigned", if you use them as small numbers and not as actual characters.

UvB>   * Range problems: cc65 has 16 bit ints. So if your code relies on the fact
UvB>     that anything greater than 16 bit is silently dropped, it may not work
UvB>     well on most platforms supported by gcc, because on these platforms, ints
UvB>     are often 32 bits.

yesyesyes.... it was a combination of both actually ;=P

the cc65 code heavily relied on chars beeing 8bit unsigned, the
intermediate values relied on int beeing 16bit signed etc pp ;=)

nevermind ;)

-- 
Best regards,
 groepaz                            mailto:groepaz_at_gmx.net


----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo_at_musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.


Date view Thread view Subject view

This archive was generated by hypermail 2.1.3 : 2002-03-15 15:08:27 CET