Domanda

I've to use #pragma pack(pop,1) in GCC, but when I compile I receive this warning:

malformed ‘#pragma pack(pop[, id])’ - ignored

Can anybody tell me if this is a good fix:

#pragma pack(pop)
#pragma pack(1)

Thank you very much :)

È stato utile?

Soluzione

Why would you want to use #pragma pack(pop, 1)? What would that mean?

The normal use case is something like:

#pragma pack(push, 1) // save current pack setting and set to 1

...

#pragma pack(pop)     // return to previous pack setting
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top