2

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

1
  • 3
    What exactly do you think pack(pop, 1) should do? Commented Oct 14, 2013 at 18:49

1 Answer 1

13

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
Sign up to request clarification or add additional context in comments.

1 Comment

I don't think that's legal code. Just delete the ,1 from the pop directive.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.