Forgot pragma pack(pop) program crashes

62 views Asked by At
#pragma pack(push, 1)
typedef enum __attribute__ ((__packed__)) {
    ETypeZero = 0,
    ETypeOne,
    ETypeTwo,
    ETypeUndefined
} ESomeType;
#pragma pack(pop)

In my code above, I had accidentally forgot #pragma pack(pop), and I saw some other data down the line getting corrupted. Why would that have occurred? Also, is there a GCC flag that can detect the missing pop?

0

There are 0 answers