build: Fix a couple more warnings. (#3598)

This commit is contained in:
squidbus
2025-09-13 15:33:42 -07:00
committed by GitHub
parent c51abe4e8b
commit 21a1888857
10 changed files with 27 additions and 16 deletions

View File

@@ -43,7 +43,12 @@ Tcb* GetTcbBase();
void EnsureThreadInitialized();
template <size_t size>
__attribute__((optnone)) void ClearStack() {
#ifdef __clang__
__attribute__((optnone))
#else
__attribute__((optimize("O0")))
#endif
void ClearStack() {
volatile void* buf = alloca(size);
memset(const_cast<void*>(buf), 0, size);
buf = nullptr;