[llvm-bugs] [Bug 48835] New: Wrong size of structs with bitfields with __declspec(align)ed type

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Jan 21 08:20:31 PST 2021


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

            Bug ID: 48835
           Summary: Wrong size of structs with bitfields with
                    __declspec(align)ed type
           Product: clang
           Version: 11.0
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C
          Assignee: unassignedclangbugs at nondot.org
          Reporter: ju.orth at gmail.com
                CC: blitzrakete at gmail.com, dgregor at apple.com,
                    erik.pilkington at gmail.com, llvm-bugs at lists.llvm.org,
                    richard-llvm at metafoo.co.uk

Consider

__declspec(align(8)) typedef char Char;

#pragma pack(2)

struct X {
        Char i: 1;
};

int f(void) {
        return sizeof(struct X);
}

msvc returns 2, clang returns 8 on the x86_64-pc-windows-msvc target.

-- 
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/20210121/c1094b8f/attachment.html>


More information about the llvm-bugs mailing list