[LLVMbugs] [Bug 12631] New: [Windows] Clang doesn't respect __declspec(aligned(X))

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon Apr 23 07:00:06 PDT 2012


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

             Bug #: 12631
           Summary: [Windows] Clang doesn't respect __declspec(aligned(X))
           Product: clang
           Version: unspecified
          Platform: PC
        OS/Version: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: timurrrr at google.com
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified


-----------------------------------
#include <stdio.h>

struct __declspec(align(16)) S {
  char x;
};


int main() {
  printf("sizeof(S) = %u\n", sizeof(S));
};
-----------------------------------

$ cl /nologo aligned.cpp && aligned.exe
sizeof(S) = 16

$ clang++ -Xclang -cxx-abi -Xclang microsoft -fms-extensions -Wmicrosoft
aligned.cpp && a.out
sizeof(S) = 1

clang++ works fine if I replace the `struct line` with:
  struct __attribute__((aligned(16))) S {

-- 
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