Skip to content

Conversation

@dmah42
Copy link
Member

@dmah42 dmah42 commented Jan 8, 2025

No description provided.

@dmah42
Copy link
Member Author

dmah42 commented Jan 8, 2025

the segfault on cxx03_test is a bit of a surprise. i'm debating whether, given we now require c++17 to build the library, it's time to drop the cxx03 stuff and clean everything up anyway.

cc @LebedevRI

@dmah42
Copy link
Member Author

dmah42 commented Jan 8, 2025

so the issue here is that the check for BENCHMARK_HAS_CXX11 is checking if the compiler supports c++11 and not if the current --std is set to C++11 (or greater). so we end up using c++11 style enum definitions which somehow compile even though the standard is set to not support them. this then causes issues with where various pointers are pointing, etc, etc, we get a jump to an invalid address.

@dmah42
Copy link
Member Author

dmah42 commented Jan 8, 2025

i think the right way to do this would be a cxx compiler check in cmake that tries to compile the enum with type, setting a define specifically for that support, then use that in place of the CXX11 check.

or we get rid of the cxx03 stuff altogether now we require C++17 :)

#endif

// This _MSC_VER check should detect VS 2017 v15.3 and newer.
#if __cplusplus >= 201703L || \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is only defined if the Zc:__cplusplus flag is enabled.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

on msvc, yes, which is why we have the rest of the check.

@dmah42
Copy link
Member Author

dmah42 commented Jan 8, 2025

running a straw poll on the discord

@dmah42
Copy link
Member Author

dmah42 commented Jan 14, 2025

see #1903 and #1906 for followons.

@dmah42 dmah42 closed this Jan 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants