RE: ANSI requirement

[email protected] ("Jan Dubois")
Newsgroups perl.perl5.porters
Organization ActiveState Software Inc
Message-ID <[email protected]>
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.

Cheers,
-Jan
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.