flexible array member

D

DevarajA

Can someone help me understand what flexible array members exactly are,
how they behave and how could them be implemented by a i386?
Also I didn't understand the two exceptions that the standards talks
about (when talking about ignoring the flexible array member). Please
help me.
 
A

aegis

DevarajA 写é“:
Can someone help me understand what flexible array members exactly are,
how they behave and how could them be implemented by a i386?
Also I didn't understand the two exceptions that the standards talks
about (when talking about ignoring the flexible array member). Please
help me.

They allow for the last member of a struct to be an incomplete type
until an oject
of such a type is allocated. As such, there is a lack of information to
determine
the size of the struct. This means that when you allocate an object
that will
represent this struct type, you can provide the information about the
size that
the struct object needs to be. Take for example a message queue system,
where
the size of the message has not yet been determined. Where you choose
to not
place constraints on a message size, you could use a flexible array
member to
represent this undetermined size.

i386 is conceptually irrelevant to the implementation of flexible array
members.
This is because an implementation that adheres to the 9899:1999
specification
is fundamentally a virtual machine. It need not care about the
underlying hardware.

As for the two exceptions, care to provide a section number from the
standard?
 
D

DevarajA

aegis ha scritto:
DevarajA 写é“:




They allow for the last member of a struct to be an incomplete type
until an oject
of such a type is allocated.

Ok, thanks.

[cut]
As for the two exceptions, care to provide a section number from the
standard?

6.7.2.16 (it should be page 103, but I'm not sure because I've got it on
pdf)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,534
Members
45,007
Latest member
obedient dusk

Latest Threads

Top