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

Pointer<->Int casts are not constexpr #8796

Merged
merged 1 commit into from
Jan 9, 2023
Merged

Conversation

mcspr
Copy link
Collaborator

@mcspr mcspr commented Jan 9, 2023

Gcc is more lenient with this, Clang is not

@@ -34,7 +33,7 @@ constexpr bool __byteAddressable(const void* addr)
#include <sys/config.h>

// returns true when addr can be used without "pgm_" functions or non32xfer service
constexpr bool __byteAddressable(const void* addr)
inline bool __byteAddressable(const void* addr)
{
return addr < (const void*)(XCHAL_DATARAM0_VADDR + XCHAL_DATARAM0_SIZE);
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

-Winvalid-constexpr

error: constexpr function never produces a constant expression [-Winvalid-constexpr]
note: cast that performs the conversions of a reinterpret_cast is not allowed in a constant expression

(where ^ points at XCHAL expression)

@mcspr mcspr changed the title Function arguments are not constexpr Pointer<->Int casts are not constexpr Jan 9, 2023
@mcspr mcspr merged commit df59774 into esp8266:master Jan 9, 2023
@mcspr mcspr deleted the this-no-constexpr branch January 9, 2023 18:08
@mcspr mcspr added this to the 3.1.1 milestone Jan 9, 2023
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.

None yet

1 participant