Re: [edk2] How to align auto variables?

Subject: Re: [edk2] How to align auto variables?

From: Andrew Fish <>


Date: 2013-02-13 17:37:27

Are you using L"" for the strings? 

Are the Unicode strings in your static library? If so then maybe the issue is the compiler flags used to compile the EDK 1.6 static library, but I though Visual Studio defaults to natural alignment, so L"" should get aligned? I guess it could also be a stray #pragma pack(1) in the code. 

If it was an issue in the compiler flags then you would think the edk2 code would also have this issue. 

Andrew Fish

On Feb 13, 2013, at 9:19 AM, "Prakash, Sathya" <> wrote:

I am able to compile my code successfully with UDK but when I run my code I see lot ASSERTS similar to ASSERT (((UINTN) String & BIT0) == 0);
I have used a static library in my code which is compiled in EDK1.6 (I need to port that to UDK but for now I am keeping this way to do some basic testing)
I would like to know how to tell the compiler to align the char array allocated in string to be aligned to avoid the ASSERT?  Do I need to use __declspec(align(#)) across all the variable definitions, can I pass it once as a compile flag?
Free Next-Gen Firewall Hardware Offer
Buy your Sophos next-gen firewall before the end March 2013 
and get the hardware for free! Learn more.
edk2-devel mailing list