Re: struct and union alignment
In <2rh5sgF1a5m6aU 1@uni-berlin.de> "S.Tobias" <sNOiSPAMt@amu. edu.pl> writes:
[color=blue]
>Keith Thompson <kst-u@mib.org> wrote:[color=green]
>> "S.Tobias" <sNOiSPAMt@amu. edu.pl> writes:[color=darkred]
>> > 6.2.5#26 (Types):
>> > All pointers to structure types shall have the same representation and
>> > alignment requirements as each other. All pointers to union types shall
>> > have the same representation and alignment requirements as each other.
>> >
>> > Does it mean that *all* structure (or union) types have the same
>> > alignment?[/color][/color]
>[color=green]
>> No, it's referring to the alignment of the pointer, not the alignment
>> of the struct or union.[/color]
>
>What's the difference?[/color]
If you can't grasp the difference between a pointer and the pointed-to
object, stop messing with the C standard and read K&R2 (again).
Dan
--
Dan Pop
DESY Zeuthen, RZ group
Email: Dan.Pop@ifh.de
Currently looking for a job in the European Union
In <2rh5sgF1a5m6aU 1@uni-berlin.de> "S.Tobias" <sNOiSPAMt@amu. edu.pl> writes:
[color=blue]
>Keith Thompson <kst-u@mib.org> wrote:[color=green]
>> "S.Tobias" <sNOiSPAMt@amu. edu.pl> writes:[color=darkred]
>> > 6.2.5#26 (Types):
>> > All pointers to structure types shall have the same representation and
>> > alignment requirements as each other. All pointers to union types shall
>> > have the same representation and alignment requirements as each other.
>> >
>> > Does it mean that *all* structure (or union) types have the same
>> > alignment?[/color][/color]
>[color=green]
>> No, it's referring to the alignment of the pointer, not the alignment
>> of the struct or union.[/color]
>
>What's the difference?[/color]
If you can't grasp the difference between a pointer and the pointed-to
object, stop messing with the C standard and read K&R2 (again).
Dan
--
Dan Pop
DESY Zeuthen, RZ group
Email: Dan.Pop@ifh.de
Currently looking for a job in the European Union
Comment