Re: [cc65] Another wish: Unsized Arrays in Structures

Date view Thread view Subject view

From: Spiro Trikaliotis (trik-news_at_gmx.de)
Date: 2003-01-29 18:06:01


Hello Uz,

you wrote:

> After checking the given URL, I found out that Microsofts implementation
> differs from the standard. The feature called "flexible array members" does
> legalize a common practice that is also used frequently in the cc65 compiler
> sources:
>
>        struct foo {
>            int x, y;
>            char name[1];
>        };
>
>        ...
>        struct foo* f = malloc (sizeof (foo) + strlen (name));
>        ...

this is not the same because here, char name[...] has 1 element, while the
MS specific stuff has not.


> The difference is that the standard does not allow initialization for flexible
> array members, while Microsoft allows this.

Ok, this is something I have not thought of. In fact, I never even used it,
and I cannot find an example where this might be usefull.

> > I have seen this feature on other plattforms for embedded controllers long
> > before Microsoft used it, so I think you should not blame MS.
>
> I'm still not decided how useful this feature actually is. 

I only meant the declaration, not initialization. My mistake. ;-)

Bye,
   Spiro.
----------------------------------------------------------------------
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-01-29 18:06:48 CET