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
test.cpp (662 Bytes)