Luca D'Amico
Luca D'Amico

Reputation: 3222

using pragma pack (pop,1) with GCC

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 :)

Upvotes: 2

Views: 9089

Answers (1)

Carl Norum
Carl Norum

Reputation: 225242

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

Upvotes: 13

Related Questions