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

Fix a compile error by using clang-x86_64-pc-windows-msvc #1890

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/host/pico_platform/include/pico/platform.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ extern void tight_loop_contents();
#define __STRING(x) #x
#endif

#ifndef _MSC_VER
#if !defined(_MSC_VER) || defined(__clang__)
Copy link
Contributor

Choose a reason for hiding this comment

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

did you mean if !defined(_MSC_VER) && !defined(__clang__)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, it's not. The changes were intended to disable LL.74-103 when using clang-x86_64-pc-windows-msvc.

clang-x86_64-pc-windows-msvc has built-in functions like gcc syntax. Specifically there are __builtin_unreachable and __builtin_clz. Also, clang-x86_64-pc-windows-msvc has a macro _MSC_VER already defined. So, LL.74-103 were enabled. As a result, the compilation fails.

#ifndef __noreturn
#define __noreturn __attribute((noreturn))
#endif
Expand Down
Loading