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

Date view Thread view Subject view

From: Christian Krüger (christian.krueger_at_pace.de)
Date: 2003-08-25 11:23:10


Hi,

yesterday I had a session with cc65 2.9.2 and discovered
that my structure change


typdef struct
{
	unsigned char something;
	unsigned char else[1];
}
MyStruct;

to

typdef struct
{
	unsigned char something;
	unsigned char else[];
}
MyStruct;

still won't compile ('unknown size of struct').
I hoped that this will work, sice Uz announched the
C99 'flexible arrys' some time ago. Did I miss something?
Where is the mistake?

- - - 8< - - -

After that I encountered another wish. 'Enums' have in cc65
the size of 'ints' which is AFAIK correct, but I like to have
more suitable 'char' enums for the 6502: Typesafeness of
determinant values together with quick code. What about a
small enhancement for 'char enums'? I imagine something like
this:

__enum foo bar;		// sizeof(bar) is 1

Where this little define could keep portability:

#ifndef __enum
#define __enum enum
#endif

- - - 8< - - -

Afterall I discovered that the native type 'bool' would be a
very nice enhancement, if Uz has some spare time.. ;-)
Is this allready on his 'wishlist'?
(...this lack won't hurt so much if theres a chance for 'char enums')

Any comments?
chrisker
----------------------------------------------------------------------
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 11:25:34 CEST