summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2022-05-24 06:49:51 -0700
committerKaz Kylheku <kaz@kylheku.com>2022-05-24 06:49:51 -0700
commit735a001aece9e7b7247561201e63c7efa93b3bee (patch)
tree716224bd7ded4e43245704fef8651b4db8dd7911
parent2262860404bad7755c6a8adb10f167439037f3fa (diff)
downloadtxr-735a001aece9e7b7247561201e63c7efa93b3bee.tar.gz
txr-735a001aece9e7b7247561201e63c7efa93b3bee.tar.bz2
txr-735a001aece9e7b7247561201e63c7efa93b3bee.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.134
1 files changed, 34 insertions, 0 deletions
diff --git a/txr.1 b/txr.1
index 2ef5678d..1ac12f9f 100644
--- a/txr.1
+++ b/txr.1
@@ -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