Re: [cc65] enum size

From: Johan Kotlinski <kotlinski1gmail.com>
Date: 2009-10-19 23:39:20
Hi!

>> Wouldn't it be possible to reduce the size of enums?
>
> Not easily. Other things have to be changed to do this,

Answer accepted, thanks.

>> ...sizeof(MyStruct) is now 3. Shouldn't it be possible to reduce this
>> to 2 or even 1?
>
> sizeof(MyStruct) should be 4, not 3.

At least here it boils down to 3... (using 2.13.0)

---
typedef struct {
    enum { Foo, Bar } my_enum;
    int bit : 1;
} struct3;

typedef struct {
    int bit : 1;
} struct1;

int main() {
    printf("%i %i\n", sizeof(struct3), sizeof(struct1));
}
---
...prints "3 1".

But I'm happy with that behavior, so please don't change :)

Thanks,
Johan
----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo@musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Mon Oct 19 23:39:46 2009

This archive was generated by hypermail 2.1.8 : 2009-10-19 23:39:48 CEST