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

            Bug ID: 48910
           Summary: Wrong size of struct with aligned bitfield (Linux)
           Product: clang
           Version: 11.0
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C
          Assignee: unassignedclangb...@nondot.org
          Reporter: ju.o...@gmail.com
                CC: blitzrak...@gmail.com, dgre...@apple.com,
                    erik.pilking...@gmail.com, llvm-bugs@lists.llvm.org,
                    richard-l...@metafoo.co.uk

Consider

typedef char __attribute__((aligned(2))) Char;

struct X {
    Char c:1;
    Char d:1;
};

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

gcc returns 4, clang returns 2 on the x86_64-unknown-linux-gnu target.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to