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
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
5 changes: 2 additions & 3 deletions cores/esp8266/esp_priv.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,8 @@

#if defined(CORE_MOCK)

constexpr bool __byteAddressable(const void* addr)
constexpr bool __byteAddressable(const void*)
{
(void)addr;
return true;
}

Expand All @@ -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)

}
Expand Down