Re: [cc65] cc65 bug (?)

From: Dan <opendtv1yahoo.com>
Date: 2007-07-26 03:27:43
--- Oliver Schmidt <ol.sc@web.de> wrote:

> The program
> ---------------------------------------------
> #include <stdio.h>
> 
> short s = 1000;
> 
> void foo(char c)
> {
>   s += c;
> }
> 
> void main(void)
> {
>   foo(-10);
> 
>   printf("\n%d\n", s);
> }
> ---------------------------------------------
> should print out 990 but compiled with a rather
> recent cc65 snapshot
> it does print out 1246.

Not a bug. Use the -j option if you want signed chars.

Dan



       
____________________________________________________________________________________
Looking for a deal? Find great prices on flights and hotels with Yahoo! FareChase.
http://farechase.yahoo.com/
----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo@musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Thu Jul 26 03:27:50 2007

This archive was generated by hypermail 2.1.8 : 2007-07-26 03:27:52 CEST