-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
align memory start address #318
Conversation
more precisely, print platform alignment macro block into the generated memory header so that the output file could be reused on both platform. The content in the generated code file should be like
|
it's useless to add the macro into the generated memory header. Only if adding the macro to each array header.Test codes are as below: |
#include <stdio.h> _attribute_ ((aligned(4))) static const unsigned char det1_param_bin[] = { static const unsigned char det2_param_bin[] = { static const unsigned char det3_param_bin[] = { static const unsigned char det4_param_bin[] = { _attribute_((packed)) static const unsigned char det5_param_bin[] = { int main(int argc, char **argv){
} |
so, alignment macro should be added before both array definition.
|
reuploaded, pls check |
* make memory start address 4bytes aligned * align memory start address for MSVC
#pragma pack(4) is not effective for the arrays