[LLVMbugs] [Bug 18613] New: Layout difference of packed struct different from GCC

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sat Jan 25 10:11:15 PST 2014


            Bug ID: 18613
           Summary: Layout difference of packed struct different from GCC
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: LLVM Codegen
          Assignee: unassignedclangbugs at nondot.org
          Reporter: david.majnemer at gmail.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

we disagree with gcc but agree with icc on the following:
extern "C" int printf(const char *, ...);
struct A {};
struct B : public virtual A {};
struct C : public A {};
struct D : public A, public B {};
#pragma pack(push, 4)
struct E : public B, public A, public virtual D {};
#pragma pack(pop)
int main() { printf("sizeof(E): %zu\n", sizeof(E)); }

gcc gives sizeof(E): 24
clang and icc give sizeof(E): 20

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/20140125/405983c2/attachment.html>

More information about the llvm-bugs mailing list