[LLVMbugs] [Bug 2626] New: 2006-01-23-InitializedBitField.c uses over-width bools

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Sun Aug 3 00:48:16 PDT 2008


http://llvm.org/bugs/show_bug.cgi?id=2626

           Summary: 2006-01-23-InitializedBitField.c uses over-width bools
           Product: Test Suite
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Nightly Tester
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: nicholas at mxc.ca
                CC: llvmbugs at cs.uiuc.edu


GCC 4.3 refuses to compile 2006-01-23-InitializedBitField.c with these errors:

  2006-01-23-InitializedBitField.c:49: error: width of 'D' exceeds its type
  2006-01-23-InitializedBitField.c:50: error: width of 'D2' exceeds its type
  2006-01-23-InitializedBitField.c:71: error: width of 'D' exceeds its type
  2006-01-23-InitializedBitField.c:72: error: width of 'D2' exceeds its type
  2006-01-23-InitializedBitField.c:79: error: width of 'D' exceeds its type

because of this construct:

  struct S7 {
    _Bool D : 8;
    _Bool D2 : 8;
    int D3 : 8;
    long long : 9;
    float B;
  } s7 = { 1, 0, 123, 1.023f };

which is fair. It may be that the ABI defines that type to be 8 bits or
whatever in memory, but that doesn't mean you can demand it be any larger than
1 bit. This construct should be removed from the test.


-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list