Re: [cc65] Escape keys

Date view Thread view Subject view

From: Ullrich von Bassewitz (uz_at_musoftware.de)
Date: 2002-12-12 21:25:10


On Thu, Dec 12, 2002 at 09:14:11PM +0100, MagerValp wrote:
> Ah! Any chance of cc65 warning about return(-1) statements in a char
> foo() function? menu.c is riddled with them I'm afraid... :/

Such conversions are legal C, and I think people will hate me if I add a
warning for this. gcc (in C mode) does not even warn when comparing signed and
unsigned types (with -Wall), which is quite problematic. In C++ mode, gcc will
output warnings for comparisons, but not for conversions (also with -Wall).

I think the real problem is to assume a specific signedness for chars. The
standard says that the signedness of a standard "char" is implementation
defined. So if you need signed characters, a portable program will always have
to use "signed char" and not just char. Similar, when an unsigned character is
needed, portable programs should use "unsigned char".

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-12-12 21:25:15 CET