Re: [cc65] flexible arrays, enum & bool...

Date view Thread view Subject view

From: Ullrich von Bassewitz (uz_at_musoftware.de)
Date: 2003-08-25 12:38:58


On Mon, Aug 25, 2003 at 12:26:40PM +0200, Christian Krüger wrote:
> Ok, but that subverts the type-safeness I like to have.
> I can assign with ease 'e' every uchar I like... :-(

There is no type safeness with enums in C. Enums are freely converted into
ints and back. This is the reason, why cc65 can implement enums as they are
(not as a separate type, but simply as ints). In C, the following statements
are completely legal:

    enum foobar {
        foo,
        bar
    };
    enum foobar x = 0x55;
    int y = foo;

Maybe you're used to C++, where this is different. But cc65 is not a C++
compiler and will never be one.

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 : 2003-08-25 12:39:08 CEST