diff options
| author | rillig <rillig@NetBSD.org> | 2023-07-01 06:09:24 +0000 |
|---|---|---|
| committer | rillig <rillig@NetBSD.org> | 2023-07-01 06:09:24 +0000 |
| commit | 1a25258bf644fbb8b7ffc0aba7b345f87a14ebfa (patch) | |
| tree | c246bcfc2c145b3bd0c254bd5bcd07a31d438df5 /tests | |
| parent | 1d123bfcd7076836e1bfeef9542d2ddb0bd4ffd7 (diff) | |
lint: fix initialization of unnamed union member
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/usr.bin/xlint/lint1/init_braces.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/tests/usr.bin/xlint/lint1/init_braces.c b/tests/usr.bin/xlint/lint1/init_braces.c index 84868b586be..9f5821ddda7 100644 --- a/tests/usr.bin/xlint/lint1/init_braces.c +++ b/tests/usr.bin/xlint/lint1/init_braces.c @@ -1,4 +1,4 @@ -/* $NetBSD: init_braces.c,v 1.6 2023/06/30 22:27:47 rillig Exp $ */ +/* $NetBSD: init_braces.c,v 1.7 2023/07/01 06:09:24 rillig Exp $ */ # 3 "init_braces.c" /* @@ -97,7 +97,8 @@ init_anonymous_struct_and_union(void) return var.times.t0.ns; } -// Minimized example taken from jemalloc.c, init_lock. +// Initializers may designate members from unnamed struct/union members. +// Example code adapted from jemalloc 5.1.0, jemalloc.c, init_lock. unsigned char init_unnamed_union(void) { @@ -121,8 +122,6 @@ init_unnamed_union(void) { .padded_union = { .pad1 = { 0, 0, 0 }, -/* FIXME: Allow access to unnamed struct/union members. */ -/* expect+1: error: type 'struct padded_union' does not have member 'u1' [101] */ .u1 = 0, .pad2 = { 0, 0, 0 }, }, |
