NetBSD-Bugs archive

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

toolchain/53219: lint doesn't allow bitfields in unions



>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



Home | Main Index | Thread Index | Old Index