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

RE: ANSI requirement

Thread Previous | Thread Next
From:
Jan Dubois
Date:
June 11, 2010 10:16
Subject:
RE: ANSI requirement
Message ID:
00dd01cb0989$c75c36f0$5614a4d0$@activestate.com
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


Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About