We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b90dde3 commit fa79612Copy full SHA for fa79612
1 file changed
tests/unit/union_field_alignment.c
@@ -3,6 +3,8 @@
3
#include <stddef.h>
4
#include <stdint.h>
5
6
+// Just check if this compiles. node::x::aligner is used to impose a specific
7
+// alignment on the bytes field.
8
struct node {
9
struct node *next;
10
union {
@@ -15,9 +17,6 @@ int main(void) {
15
17
struct node n;
16
18
n.next = 0;
19
n.x.bytes[0] = 0xAB;
-
20
assert(n.x.bytes[0] == 0xAB);
- assert(sizeof(n.x) >= sizeof(void *));
21
- assert(((uintptr_t)&n.x % _Alignof(void *)) == 0);
22
return 0;
23
}
0 commit comments