Nishikant
Nishikant

Reputation: 95

Forgot pragma pack(pop) program crashes

#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?

Upvotes: 0

Views: 62

Answers (0)

Related Questions