Re: [cc65] More assignments and typecasting questions

Date view Thread view Subject view

From: Ullrich von Bassewitz (uz_at_musoftware.de)
Date: 2002-07-24 17:59:59


On Wed, Jul 24, 2002 at 05:25:10PM +0200, groepaz wrote:
> bla(unsigned char p1,unsigned short p2, [more params]);
>
> and if compiled without prototype the generated code would pass "p1"
> as a 16bit value, resulting in messed up parameters.

Yes, you are right. chars are passed as chars in presence of a prototype. If
there is no prototype, a variadic parameter list is assumed which means that
the default promotions are applied and chars are passed as ints.

Regards


        Uz


-- 
Ullrich von Bassewitz                                  uz_at_musoftware.de
----------------------------------------------------------------------
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-07-24 18:00:00 CEST