Results below.

Joerg Schilling wrote:
Steve Bennett <[EMAIL PROTECTED]> wrote:


Bad news!

sizeof(test1) is 12
offsetof(test1, more) is 8
offsetof(test1, dummy) is 10

I suppose this is the bit you are referring to:

 the  size
 of  the  structure  shall be equal to the offset of the last
 element of an otherwise identical  structure  that  replaces
 the  flexible  array  member  with  an  array of unspecified
 length.97)

That 'of unspecified length' might well account for this behaviour.


I don't see this. Let us try to do what's in the text:

Use this struct:

struct test1 { char blerg[1]; char type[4]; char flibble[3]; char more[2]; char dummy[]; };

OK. Got the usual:

sizeof(test1) is 12
offsetof(test1, more) is 8
offsetof(test1, dummy) is 10


Replace the flex array with an  an  array of unspecified (which means
irrelevent) length:

I don't think unspecified means irrelevant.


struct test2 { char blerg[1]; char type[4]; char flibble[3]; char more[2]; char dummy[1]; };

And the result:

sizeof(test1) is 12
offsetof(test1, more) is 8
offsetof(test1, dummy) is 10


Now, sizeof(test1) needs to be == offsetof(test2, dummy);

It seems that this is mot the case for GCC.

So either this is the case because the you are misunderstanding
the spec or because the GCC arm guys are misunderstanding the spec.

In any case, its irrelevant, since even if they agree with your view and "fix" 
it,
we have the compiler we have. We have no other compiler.
So we need a fix for mkisofs which works with this compiler as-is.

Regards,
Steve


Jörg


Reply via email to