[cfe-dev] possible bug in clang 4.0.0

Zheng Tao Lee via cfe-dev cfe-dev at lists.llvm.org
Sun Jun 4 23:05:08 PDT 2017


Hi,

I am using clang 4.0.0 and found this cast align error prompt to be strange.

To reproduce the error, run command below with clang 4.0.0.
c:\llvm\bin\clang++ test.cpp -c -Wcast-align -target arm -std=c++14
clang++.exe: warning: unknown platform, assuming -mfloat-abi=soft
clang++.exe: warning: unknown platform, assuming -mfloat-abi=soft
test.cpp:14:12: warning: cast from 'const AcGeVector3d *' to 'double *' increases required alignment from 4 to 8
      [-Wcast-align]
    return (double*)&vec;
           ^~~~~~~~~~~~~
1 warning generated.

AcGeVector3d is just a class containing 3 doubles and we expect it to be 8 aligned.

Thanks,
Tao

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20170605/02047b4a/attachment.html>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: test.cpp
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20170605/02047b4a/attachment.ksh>


More information about the cfe-dev mailing list