Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/xlint/lint1 lint: initialize unnamed member like an ...



details:   https://anonhg.NetBSD.org/src/rev/35da76a87f39
branches:  trunk
changeset: 377229:35da76a87f39
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sun Jul 02 09:40:25 2023 +0000

description:
lint: initialize unnamed member like an unnamed bit-field

See set_bit_field_width.

diffstat:

 usr.bin/xlint/lint1/decl.c |  7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diffs (29 lines):

diff -r 1c51e643e77f -r 35da76a87f39 usr.bin/xlint/lint1/decl.c
--- a/usr.bin/xlint/lint1/decl.c        Sun Jul 02 08:16:19 2023 +0000
+++ b/usr.bin/xlint/lint1/decl.c        Sun Jul 02 09:40:25 2023 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: decl.c,v 1.333 2023/07/02 08:16:19 rillig Exp $ */
+/* $NetBSD: decl.c,v 1.334 2023/07/02 09:40:25 rillig Exp $ */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All Rights Reserved.
@@ -38,7 +38,7 @@
 
 #include <sys/cdefs.h>
 #if defined(__RCSID)
-__RCSID("$NetBSD: decl.c,v 1.333 2023/07/02 08:16:19 rillig Exp $");
+__RCSID("$NetBSD: decl.c,v 1.334 2023/07/02 09:40:25 rillig Exp $");
 #endif
 
 #include <sys/param.h>
@@ -1053,7 +1053,10 @@ declare_unnamed_member(void)
 
        sym_t *mem = block_zero_alloc(sizeof(*mem));
        mem->s_name = unnamed;
+       mem->s_kind = FMEMBER;
+       mem->s_scl = STRUCT_MEMBER;
        mem->s_type = dcs->d_type;
+       mem->s_block_level = -1;
 
        dcs_add_member(mem);
        bitfieldtype_ok = false;



Home | Main Index | Thread Index | Old Index