It seems like the -malign-double
compiler option has been removed from Clang. Example code:
#include <stddef.h>
#include <stdio.h>
typedef struct X { char a; long long b; } X;
int main(void)
{
printf("%zd\n", offsetof(X, b));
return 0;
}
When compiled with GCC in 32-bit mode (-m32
), this can be made to output either 8 or 4 depending on if -malign-double
is enabled or not respectively. But Clang does not appear to support this option:
$ clang test.c -m32 -malign-double
clang: warning: argument unused during compilation: '-malign-double'
$ ./a.out
4
Clang version:
Apple clang version 3.1 (tags/Apple/clang-318.0.58) (based on LLVM 3.1svn)
Target: x86_64-apple-darwin11.3.0
Thread model: posix
I can't seem to find any official documentation on the full list of compiler flags supported by Clang, they just seem to defer to GCC's documentation for the most part.
Is there any current equivalent to -malign-double
in Clang? Or am I stuck having to use a different compiler for now? I need it to compile some code that links against a binary-only third-party library that uses that flag.