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:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Apr 28 03:50:00 +0000 2018
>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

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.43 2018/01/16 07:36:43 maya Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2017 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.