[PATCH] C11 _Bool bitfield diagnostic

Rachel Craik rcraik at ca.ibm.com
Mon May 25 14:06:10 PDT 2015


Hi rsmith, fraggamuffin,

The C11 standard added a new footnote to section 6.7.2.1 paragraph 4 (paragraph 3 in the C99 standard), which deals with the allowable width of a bit-field. This footnote indicates that for bit-fields of type _Bool an implementation may have a width of only 1 bit. 

This patch adds a diagnostic for _Bool bit-fields of width > 1, as the generated code may not be portable or cause unexpected issues when compiled on some platforms.

http://reviews.llvm.org/D10018

Files:
  include/clang/Basic/DiagnosticGroups.td
  include/clang/Basic/DiagnosticSemaKinds.td
  lib/Sema/SemaDecl.cpp
  test/Misc/warning-flags.c
  test/Sema/c11-bitfield-width.c

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D10018.26425.patch
Type: text/x-patch
Size: 5333 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20150525/a224daf7/attachment.bin>


More information about the cfe-commits mailing list