News for hackers. Stuff that matters.
Re:The Lost Art of C Structure Packing (2014) by maccard on Friday August 05, 2016 @06:52PM (#12236223)
> You can't have different translation units interpreting the same struct type declaration differently.

Sure you can!

    // MyHeader.h  
    struct MyStruct {  
    int A;  
    char b;  
    int* c;  
    };

    // A.cpp  
    #include "MyHeader.h"

    <...>

    // B.cpp  
    #pragma pack(push, 16)  
    #include "MyHeader.h"  
    #pragma pack(pop)

    <...>

There are no comments on this comment yet.