This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
c/3347: Too large bitfields should be errors
- To: gcc-gnats at gcc dot gnu dot org
- Subject: c/3347: Too large bitfields should be errors
- From: h dot b dot furuseth at usit dot uio dot no
- Date: Thu, 21 Jun 2001 22:00:27 +0200
- Cc: h dot b dot furuseth at usit dot uio dot no
- Reply-To: h dot b dot furuseth at usit dot uio dot no
>Number: 3347
>Category: c
>Synopsis: Too large bitfields should be errors
>Confidential: no
>Severity: non-critical
>Priority: medium
>Responsible: unassigned
>State: open
>Class: accepts-illegal
>Submitter-Id: net
>Arrival-Date: Thu Jun 21 13:06:00 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator: Hallvard B Furuseth
>Release: 3.0 20010611 (prerelease)
>Organization:
University of Oslo, Norway
>Environment:
System: SunOS bombur.uio.no 5.8 Generic_108528-03 sun4u sparc SUNW,Ultra-5_10
Architecture: sun4
host: sparc-sun-solaris2.8
build: sparc-sun-solaris2.8
target: sparc-sun-solaris2.8
configured with: ./configure --quiet
>Description:
A too large bitfield is a constraint violation of C99 6.7.2.1p3.
I think it violates ANSI and K&R too, but I can't check that.
Gcc only gives a plain warning, even under -std=c99 -pedantic.
>How-To-Repeat:
bash$ echo 'struct { int i : 9999; } x;' > a.c
bash$ ./xgcc -B./ -std=c99 -pedantic -o /dev/null -S a.c
a.c:1: warning: width of `i' exceeds its type
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted: