develooper Front page | perl.perl5.porters | Postings from June 2010

RE: ANSI requirement

Thread Previous | Thread Next
Jan Dubois
June 11, 2010 10:16
RE: ANSI requirement
Message ID:
On Fri, 11 Jun 2010, Ævar Arnfjörð Bjarmason wrote:
> I vaguely recall someone mentioning that we rely on some features of C
> that aren't strictly guaranteed by ANSI C, such as the the offset into
> a struct being the sum of the sizeof() of the struct members that came
> before in the struct.

I seriously doubt that we rely on it because it would not work unless
there is *no* structure padding at all.  Nicholas has been working hard
to remove most unused padding, but I don't believe there is any code in
Perl that is adding up sizes of individual struct members.

And anyways, ANSI C has the offsetof() macro if you ever really need to
know an explicit offset.


Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About