summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/H5Tnative.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/H5Tnative.c b/src/H5Tnative.c
index 6dc5ea0..4567fe5 100644
--- a/src/H5Tnative.c
+++ b/src/H5Tnative.c
@@ -975,6 +975,14 @@ get_host_byte_order(void)
herr_t
H5T__init_native_int(void)
{
+ /* Here we construct a type that lets us find alignment constraints
+ * without using the alignof operator, which is not available in C99.
+ *
+ * Between each sub-struct's `char` member `c` and member `x`, the
+ * compiler must insert padding to ensure proper alignment of `x`.
+ * We can find the alignment constraint of each `x` by looking at
+ * its offset from the beginning of its sub-struct.
+ */
typedef struct {
struct {
char c;