diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2022-05-24 06:49:51 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2022-05-24 06:49:51 -0700 |
commit | 4c31a9e7cf0cace0b0656c40548ae2fafb5968aa (patch) | |
tree | 716224bd7ded4e43245704fef8651b4db8dd7911 | |
parent | 5309ba6bd71ef4e1a37029c014cc3fd79e003aec (diff) | |
download | txr-4c31a9e7cf0cace0b0656c40548ae2fafb5968aa.tar.gz txr-4c31a9e7cf0cace0b0656c40548ae2fafb5968aa.tar.bz2 txr-4c31a9e7cf0cace0b0656c40548ae2fafb5968aa.zip |
doc: add a note about pack.
* txr.1: pack with alignment values greater than 1 doesn't
directly correspond to a single GNU C feature.
-rw-r--r-- | txr.1 | 34 |
1 files changed, 34 insertions, 0 deletions
@@ -81476,6 +81476,40 @@ After these transformations are applied, the nested forms which occur in the transformed syntax may perform more such transformations, depending on their operands. +Note that the two-argument form of +.code pack +with a +.meta width +value greater than 1 doesn't directly correspond to any +single attribute specifier in GNU C. The GNU C +.code packed +attribute is Boolean, implicitly reducing alignment to 1. +A combination of the GNU C attributes +.code aligned +and +.code packed +is used to produce the effect of +.mono +.meti (pack < n << type ) +.onom +for values of +.meta n +> 1. +In GNU C, the +.code packed +attribute, when applied to a structure, distributes to its members, +but isn't capable of distributing an alignment exceeding 1. So the +.mono +.meti (pack < n (struct ...)) +.onom +expression, for values of +.meta n +> 1, doesn't correspond to anything in GNU C; its effect +can be simulated by attributing the structure type with +.codn packed , +and then individually applying the required alignment to +the member declarations. + .SS* Additional Types .coNP FFI types @, size-t @, ptrdiff-t @, int-ptr-t @, uint-ptr-t @, intmax-t @, uintmax-t @ wint-t @, sig-atomic-t @ time-t and @ clock-t .desc |