[llvm-bugs] [Bug 29019] New: Wanted: portability warning for bitfield declared as 'int' in C

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Aug 17 09:37:27 PDT 2016


https://llvm.org/bugs/show_bug.cgi?id=29019

            Bug ID: 29019
           Summary: Wanted: portability warning for bitfield declared as
                    'int' in C
           Product: clang
           Version: unspecified
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Frontend
          Assignee: unassignedclangbugs at nondot.org
          Reporter: jordan_rose at apple.com
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

C11 6.7.2p5: Each of the comma-separated multisets designates the same type,
except that for bit-fields, it is implementation-defined whether the specifier
`int` designates the same type as `signed int` or the same type as `unsigned
int`.

When compiling C code, Clang should have a warning if you use a bare 'int' as
the type of a bitfield.

struct Test {
  int x: 5; // warn here
};

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20160817/dff093ce/attachment.html>


More information about the llvm-bugs mailing list