[cfe-dev] Work around for compiler error parsing 'aligned' attribute? (Bug 11071)?

Jeffrey Walton noloader at gmail.com
Thu Feb 28 19:38:11 PST 2013

Hi All,

I'm very unclear of what is going on with the GNU C/GCC attributes. It
appears they should work, but they don't. And bugs relating to them
have gone unacknowledged for years.

First, Clang claims to support GNU C/GCC 4.2.1:

$ clang -dM -E -x c /dev/null | grep -i gnuc
#define __GNUC_MINOR__ 2
#define __GNUC_PATCHLEVEL__ 1
#define __GNUC_STDC_INLINE__ 1
#define __GNUC__ 4

Second, __attribute__(align) is circa GCC 3.0. GCC 3.0 is from 2001,
while GCC 4.2.1 is from 2007

Third, the docs don't list __attribute__(align) as "Intentionally
unsupported GCC extensions" per

Fourth, __attribute__(align) is not listed as "GCC extensions not
implemented yet" per

Does anyone have any ideas to work around the compile problems when
using Clang? I really don't want to give it up because of its analysis
capabilities (especially since my copy of 3.1 it has Li and Regehr's
IOC patch).


On Thu, Feb 28, 2013 at 5:41 PM, Jeffrey Walton <noloader at gmail.com> wrote:
> Hi All,
> I'm using Clang 3.1, and am having problems with __aligned__ attribute
> as reported in http://llvm.org/bugs/show_bug.cgi?id=11071 (reported
> 10/2011).
> Are there any workarounds that I can apply to get past my compilation problems?
> $ clang --version
> clang version 3.1 (branches/release_31)
> Target: x86_64-unknown-linux-gnu
> Thread model: posix

More information about the cfe-dev mailing list