This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
About address alignment of unicode string data
- From: "Lu, Ken" <ken dot lu at intel dot com>
- To: <gcc-help at gcc dot gnu dot org>
- Date: Fri, 30 Mar 2007 11:01:32 +0800
- Subject: About address alignment of unicode string data
Hello:
I have question about GCC which is in different behavior with MS VC.
See following code:
wchar_t *TestStr = L"MyString";
If built by MSVC, the address TestStr would align at 16-bit boundary
that mean TestStr's address is even. Because the data of L"MyString" is
unicode code string.
But if build by GCC, the address of TestStr is even or odd but not
always even.
I have tried many GCC compiler options but seems not compiler
options can make the address of TestStr align to even address. My GCC
version is 4.0.2.
Who can tell me how to control the alignment of const Unicode data
L"" in GCC?
Thanks.
- K
Best Regard!
------------------------------------------------------------------------
------------
Hear and you forget; see and you remember; do and you understand.
--Confucius
"The content of this message is my personal opinion only and although I
am an employee of Intel, the statements I make here in no way represent
Intel's position on the issue, nor am I authorized to speak on behalf of
Intel on this matter"