diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2022-05-20 06:38:44 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2022-05-20 06:38:44 -0700 |
commit | 48b4ba967a3c04c7dd263e775e0cbbb03ed58e8f (patch) | |
tree | 678a01888e57184e4419d18ca2995bf2bf5972f5 | |
parent | 1c70056c20ad0001b45daa7289c01d0eb3577211 (diff) | |
download | txr-48b4ba967a3c04c7dd263e775e0cbbb03ed58e8f.tar.gz txr-48b4ba967a3c04c7dd263e775e0cbbb03ed58e8f.tar.bz2 txr-48b4ba967a3c04c7dd263e775e0cbbb03ed58e8f.zip |
ffi: behavior of align subject to compat.
* ffi.c (ffi_type_compile): Allow align to weaken (lower) alignment
if compatibility 275 or lower is requested.
* txr.1: Compat note added.
-rw-r--r-- | ffi.c | 3 | ||||
-rw-r--r-- | txr.1 | 16 |
2 files changed, 18 insertions, 1 deletions
@@ -4358,7 +4358,8 @@ val ffi_type_compile(val syntax) } else { val altype_copy = ffi_type_copy(altype); struct txr_ffi_type *atft = ffi_type_struct(altype_copy); - if (al > atft->align || sym == pack_s) + if (al > atft->align || sym == pack_s || + (opt_compat && opt_compat <= 275)) atft->align = al; return altype_copy; } @@ -88335,6 +88335,22 @@ of these version values, the described behaviors are provided if is given an argument which is equal or lower. For instance .code "-C 103" selects the behaviors described below for version 105, but not those for 102. +.IP 275 +In \*(TX 275 and older versions, the FFI type operator +.code align +can weaken the alignment of a type. The current behavior is that it can +only increase the strictness of alignment, which mimics the +.code aligned +type attribute found in GNU C. For instance +.code "(align 2 int)" +will not have an effect, because 2 is lower than the alignment of +.codn int . +The +.code pack +type operator must be used instead to specify any alignment, including +lower. A compatibility value of 275 or lower restores the ability of +.code align +to specify weaker alignment. .IP 273 In \*(TX 273 and older versions, .code lazy-str-get-trailing-list |