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

question/request: enable clang/gcc sanitizers on windows #288

Open
FeignClaims opened this issue Nov 1, 2024 · 2 comments
Open

question/request: enable clang/gcc sanitizers on windows #288

FeignClaims opened this issue Nov 1, 2024 · 2 comments

Comments

@FeignClaims
Copy link
Contributor

FeignClaims commented Nov 1, 2024

My junior classmate is trying to learn C++ with my vscode tutorial that uses clang installed by msys2 on windows, but I noticed project_options won't enable sanitizers for him because,

if(NOT "${CMAKE_SYSTEM_NAME}" STREQUAL "Windows" AND (CMAKE_CXX_COMPILER_ID STREQUAL "GNU"
OR CMAKE_CXX_COMPILER_ID MATCHES ".*Clang")
)

As a result, the cmake configuration says,

No sanitizer is supported for the current platform/compiler

I removed the above NOT "${CMAKE_SYSTEM_NAME}" STREQUAL "Windows" and configured again, the sanitizers are enabled and work correctly.

So I'm wondering why dose project_options disable clang/gcc sanitizers on windows and I suggest maybe we should investigate the current support for sanitizers on windows. (BTW Unfortunately, I can't reach my windows computer until next year).

Upvote & Fund

@aminya is using Polar.sh so you can upvote and help fund this issue. The funding is received once the issue is completed & confirmed by you.

Thank you in advance for helping prioritize & fund our backlog!


Fund with Polar
@aminya
Copy link
Owner

aminya commented Nov 12, 2024

These conditions were added because it didn't work on Windows back when I wrote the code. Which versions of the compilers would work? We can allow recent versions if know the range.

@FeignClaims
Copy link
Contributor Author

These conditions were added because it didn't work on Windows back when I wrote the code. Which versions of the compilers would work? We can allow recent versions if know the range.

Not sure yet. I'll have to wait until next year when I can get a Windows computer to try them out specifically. The example above is clang 18.1.8 installed in the msys2 clang64 environment. That is,

$ clang --version
clang version 18.1.8
Features: windows
Platform: x86_64-w64-windows-gnu

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

No branches or pull requests

2 participants