[cc65] cc65 bug (?)

From: Oliver Schmidt <ol.sc1web.de>
Date: 2007-07-26 01:43:41
Hi,

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. This is independent from the cc65
optimizations and seems to result from a sign promotion issue of the
formal parameter in foo().

Thanks in advance for your consideration, 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 Thu Jul 26 01:43:48 2007

This archive was generated by hypermail 2.1.8 : 2007-07-26 01:43:51 CEST