From: Jarkko Hietaniemi Date: Mon, 21 Aug 2006 22:39:35 +0000 (+0300) Subject: perlhack.pod: small porta-tweaks (this time without pod2man :-) X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=606fd33d334f8edd9f204342f82ec81c3bb776b1;p=p5sagit%2Fp5-mst-13.2.git perlhack.pod: small porta-tweaks (this time without pod2man :-) Message-Id: <200608211939.k7LJdZ9P170671@kosh.hut.fi> p4raw-id: //depot/perl@28743 --- diff --git a/pod/perlhack.pod b/pod/perlhack.pod index d459fe5..ffce50f 100644 --- a/pod/perlhack.pod +++ b/pod/perlhack.pod @@ -2473,8 +2473,9 @@ warnings are given unless you also compile with C<-O>. Also study L carefully to avoid any bad assumptions about the operating system, filesystem, and so forth. -You may once in a while try a "make miniperl" to see whether we +You may once in a while try a "make microperl" to see whether we can still compile Perl with just the bare minimum of interfaces. +(See README.micro.) Do not assume an operating system indicates a certain compiler. @@ -2544,7 +2545,8 @@ or maybe use temporary variables, or dirty tricks with unions. =item * -Assume B about structs +Assume B about structs (especially the ones you +don't control, like the ones coming from the system headers) =over 8 @@ -2558,23 +2560,39 @@ That no other fields exist besides the ones you know of =item * -That a field is a certain signedness, sizeof, or type +That a field is of certain signedness, sizeof, or type =item * That the fields are in a certain order +=over 8 + =item * -That the sizeof(struct) is the same everywhere +While C guarantees the ordering specified in the struct definition, +between different platforms the definitions might differ + +=back =item * -That there is no padding between the fields +That the sizeof(struct) or the alignments are the same everywhere + +=over 8 =item * -That there are no alignment requirements for the fields +There might be padding bytes between the fields to align the fields - +the bytes can be anything + +=item * + +Structs are required to be aligned to the maximum alignment required +by the fields - which for native types is for usually equivalent to +sizeof() of the field + +=back =back