NetBSD Problem Report #53219
From dholland@macaran.eecs.harvard.edu Sat Apr 28 03:49:44 2018
Return-Path: <dholland@macaran.eecs.harvard.edu>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
by mollari.NetBSD.org (Postfix) with ESMTPS id 4070B7A1DF
for <gnats-bugs@gnats.NetBSD.org>; Sat, 28 Apr 2018 03:49:44 +0000 (UTC)
Message-Id: <20180428034933.98E5B6E29E@macaran.eecs.harvard.edu>
Date: Fri, 27 Apr 2018 23:49:33 -0400 (EDT)
From: dholland@eecs.harvard.edu
Reply-To: dholland@NetBSD.org
To: gnats-bugs@NetBSD.org
Subject: lint doesn't allow bitfields in unions
X-Send-Pr-Version: 3.95
>Number: 53219
>Category: toolchain
>Synopsis: lint doesn't allow bitfields in unions
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: toolchain-manager
>State: closed
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Sat Apr 28 03:50:00 +0000 2018
>Closed-Date: Mon Feb 07 02:47:05 +0000 2022
>Last-Modified: Mon Feb 07 02:47:05 +0000 2022
>Originator: David A. Holland
>Release: NetBSD 8.99.14 (20180402)
>Organization:
>Environment:
System: NetBSD macaran 8.99.14 NetBSD 8.99.14 (MACARAN) #48: Mon Apr 2 18:37:50 EDT 2018 dholland@macaran:/usr/src/sys/arch/amd64/compile/MACARAN amd64
Architecture: x86_64
Machine: amd64
>Description:
lint doesn't allow bitfields to appear in unions.
Having a bitfield in a union seems fairly useless, but doesn't appear
to be prohibited by the C standard.
>How-To-Repeat:
--- foo.c ---
union foo {
int x;
unsigned y : 7;
};
------
% lint -chapbxzgFS foo.c
foo.c:
foo.c(3): illegal use of bit-field [41]
Exit 1
%
>Fix:
dunno
>Release-Note:
>Audit-Trail:
From: "Roland Illig" <rillig@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc:
Subject: PR/53219 CVS commit: src/tests/usr.bin/xlint/lint1
Date: Mon, 7 Feb 2022 02:39:10 +0000
Module Name: src
Committed By: rillig
Date: Mon Feb 7 02:39:10 UTC 2022
Modified Files:
src/tests/usr.bin/xlint/lint1: msg_041.c msg_041.exp
Log Message:
tests/lint: add test for message 41 about bit-field in union
See PR toolchain/53219.
To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/tests/usr.bin/xlint/lint1/msg_041.c \
src/tests/usr.bin/xlint/lint1/msg_041.exp
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
From: "Roland Illig" <rillig@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc:
Subject: PR/53219 CVS commit: src
Date: Mon, 7 Feb 2022 02:44:49 +0000
Module Name: src
Committed By: rillig
Date: Mon Feb 7 02:44:49 UTC 2022
Modified Files:
src/tests/usr.bin/xlint/lint1: msg_041.c msg_041.exp
src/usr.bin/xlint/lint1: decl.c err.c
Log Message:
lint: reword message about bit-field in a union
There is nothing illegal about a bit-field in a union, it is allowed by
C90, C99 and C11.
Fixes PR toolchain/53219.
To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/tests/usr.bin/xlint/lint1/msg_041.c \
src/tests/usr.bin/xlint/lint1/msg_041.exp
cvs rdiff -u -r1.243 -r1.244 src/usr.bin/xlint/lint1/decl.c
cvs rdiff -u -r1.151 -r1.152 src/usr.bin/xlint/lint1/err.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
State-Changed-From-To: open->closed
State-Changed-By: rillig@NetBSD.org
State-Changed-When: Mon, 07 Feb 2022 02:47:05 +0000
State-Changed-Why:
Fixed in decl.c 1.243 and err.c 1.152, thanks for the PR.
The error had been downgraded to a warning in decl.c 1.241 from
2021-09-17 already.
>Unformatted:
(Contact us)
$NetBSD: query-full-pr,v 1.46 2020/01/03 16:35:01 leot Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2020
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.