This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

关于C6748下字节对齐的问题



定义了如下的Union:

union UNI_Frame_Test
{
        // #pragma DATA_ALIGN(ArrayU16, 2);
        Uint8 ArrayU8[44];

        struct
        {
                Uint32 U32_1;
                Uint32 U32_2;

                double f64_1;
                int8 i8_1;
                double f64_2;
                int8 i8_2;
                double f64_3;
                float f32_1;
                Uint32 U32_3;

                int8 i8_3;
                int8 i8_4;

        }strTestUnionData;
};

union UNI_Frame_Test g_testUnionData;

目的:将收到的串行数据copy到union的数组中,这样就可直接从struct中取数据。

现在试了一下,f64_2读出的数据是乱的。

问题:C6748是否支持单字节对齐方式?查了一下,好像只支持4字节整数倍?谢谢!