This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Specify alignment for string literal.
- From: Kaz Kylheku <kaz at kylheku dot com>
- To: <gcc-help at gcc dot gnu dot org>
- Date: Sun, 09 Oct 2011 17:34:32 -0700
- Subject: Specify alignment for string literal.
Hi all,
Is there any way to specify the alignment of a literal, with
__attribute__
((align ...))
That is to say:
/* wchar_t is 16 bits and 2 byte aligned on this
platform; I want 4 byte alignment */
wchar_t *foo = L"...";
The attribute has to go on the literal object, not on foo, obviously.
If there is such a feature, it's not obviously documented in the
manual.
I have other ways of solving the problem I'm working on, but this
would be ideal.