Skip to content
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

pragma pack(push, 1) will crash #4671

Open
2 tasks
atomburg opened this issue Feb 28, 2025 · 2 comments
Open
2 tasks

pragma pack(push, 1) will crash #4671

atomburg opened this issue Feb 28, 2025 · 2 comments
Labels
kind: bug state: needs more info the author of the issue needs to provide more details

Comments

@atomburg
Copy link

Description

use different pack, e.g. 1 for source1.cpp and other for source2.cpp, will crash the second json instance.

Reproduction steps

#pragma pack(push, 1)
json j1;
#pragma pack(push,4)
json j2;// crashed on contains(...) call.

Expected vs. actual results

crash

Minimal code example

Error messages

Compiler and operating system

msvc2022

Library version

3.11.3

Validation

@nlohmann
Copy link
Owner

Please provide a complete code example.

@nlohmann nlohmann added the state: needs more info the author of the issue needs to provide more details label Feb 28, 2025
@gregmarr
Copy link
Contributor

As @nlohmann says, we would need to see a complete code example, but this seems like it's going to be a One Definition Rule violation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: bug state: needs more info the author of the issue needs to provide more details
Projects
None yet
Development

No branches or pull requests

3 participants