Skip to content

Failure to expand macro in pragma pack for MS compatibility #18950

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
llvmbot opened this issue Jan 22, 2014 · 4 comments
Closed

Failure to expand macro in pragma pack for MS compatibility #18950

llvmbot opened this issue Jan 22, 2014 · 4 comments
Labels
bugzilla Issues migrated from bugzilla clang Clang issues not falling into any other category

Comments

@llvmbot
Copy link
Member

llvmbot commented Jan 22, 2014

Bugzilla Link 18576
Resolution FIXED
Resolved on Feb 20, 2014 17:01
Version trunk
OS All
Reporter LLVM Bugzilla Contributor
CC @rnk

Extended Description

MSVC uses directives that look like:

#pragma push(pack,_CRT_PACKING)

When requesting preprocessed output specified on the command-line to clang-cl ("/P"), the output does not expand _CRT_PACKING.

Reproduction steps:

  1. Create a file with #include <windows.h>
  2. clang-cl /P
  3. Observe results in .i by searching for #pragma pack(push,_CRT_PACKING)

Expected Results:

  • #pragma pack(push,_CRT_PACKING) should not be found and it should be #pragma pack(push,8)

Other notes:

  • This was observed by trying to compile a file using pre-processed source output, so a good test case might be to #include <windows.h>, preprocess, then try to compile the preprocessed file. If successful, it's fixed.
@rnk
Copy link
Collaborator

rnk commented Jan 22, 2014

This has also been bugging me since forever. We should really fix this. Warren, can you look at this?

@llvmbot
Copy link
Member Author

llvmbot commented Jan 23, 2014

Yeah, I'll do it after I Get CGRecordLayout fixed.

@rnk
Copy link
Collaborator

rnk commented Feb 21, 2014

Fixed with a hack in r201821.

@rnk
Copy link
Collaborator

rnk commented Nov 26, 2021

mentioned in issue llvm/llvm-bugzilla-archive#19529

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 9, 2021
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugzilla Issues migrated from bugzilla clang Clang issues not falling into any other category
Projects
None yet
Development

No branches or pull requests

2 participants