[llvm-bugs] [Bug 48890] New: Incorrect alignment of __attribute__((aligned)) enum

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Jan 26 10:31:47 PST 2021


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

            Bug ID: 48890
           Summary: Incorrect alignment of __attribute__((aligned)) enum
           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

enum __attribute__((aligned(8))) E {
        A = 1,
};

int g(void) {
    return _Alignof(enum E);
}

gcc returns 4, clang returns 8 on x86_64-unknown-linux-gnu. Gcc appears to
ignored this attribute on enums.

-- 
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/20210126/a29df7c5/attachment.html>


More information about the llvm-bugs mailing list