Skip to content

Commit

Permalink
Enable Wall/Wextra flags for Wasm builds
Browse files Browse the repository at this point in the history
We only had one warning in Wasm stubs which this change fixes as well.
  • Loading branch information
zeux committed Sep 27, 2024
1 parent b1e5449 commit bcb507f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ WASMCC?=$(WASI_SDK)/bin/clang++
WASIROOT?=$(WASI_SDK)/share/wasi-sysroot

WASM_FLAGS=--target=wasm32-wasi --sysroot=$(WASIROOT)
WASM_FLAGS+=-Wall -Wextra
WASM_FLAGS+=-O3 -DNDEBUG -nostartfiles -nostdlib -Wl,--no-entry -Wl,-s
WASM_FLAGS+=-mcpu=mvp # make sure clang doesn't use post-MVP features like sign extension
WASM_FLAGS+=-fno-slp-vectorize -fno-vectorize -fno-unroll-loops
Expand Down
2 changes: 1 addition & 1 deletion tools/wasmstubs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ extern "C" void* sbrk(intptr_t increment)

size_t heap_size = __builtin_wasm_memory_size(0) * WASM_PAGE_SIZE;

if (sbrkp > heap_size)
if (size_t(sbrkp) > heap_size)
{
size_t diff = (sbrkp - heap_size + WASM_PAGE_SIZE - 1) / WASM_PAGE_SIZE;

Expand Down

0 comments on commit bcb507f

Please sign in to comment.