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

Date view Thread view Subject view

From: Ullrich von Bassewitz (uz_at_musoftware.de)
Date: 2003-02-06 00:15:36


On Thu, Feb 06, 2003 at 12:01:53AM +0100, Maciej Witkowiak wrote:
> This is offtopic, but what do you mean by 'unorthogonal'? I know what
> 'orthogonal' means in maths, surprisingly my Longman and Collins
> dictionaries don't note this word at all so I can only guess the metaphor.

Maybe "unorthogonal" is the wrong negation, would "non orthogonal" be better
english?

Ortogonal means that one feature can be combined with all other features. An
orthogonal instruction set for a CPU means that you can combine all
instructions with all registers and all addressing modes (it can be easily
seen that the 6502 instruction set is highly non orthogonal).

With respect to the flexible array member feature this means that there are
several exceptions where initialization does not work. 

  * Single struct with flexible members can be initialized.

  * Arrays of such structs cannot be initialized.

  * A struct can contain structs that contain flexible array members. In this
    case, only the flexible array member in the last such struct can be
    initialized. This is also true for deeper nestings and if the struct is
    nested into something else (a union or whatever).

  * structs with flexible array members declared as "register" cannot be
    initialized (this is a cc65 specific exception and shouldn't be a real
    problem, because the standard register bank has only 6 bytes anyway).

I think all this is the reason why the standard does not allow initialization.

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-02-06 00:17:36 CET