diff options
-rw-r--r-- | CMakeLists.txt | 4 | ||||
-rw-r--r-- | src/s2wasm.h | 6 | ||||
-rw-r--r-- | src/tools/wasm2asm.cpp | 2 |
3 files changed, 8 insertions, 4 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 13f963106..749bf6f33 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -67,11 +67,15 @@ IF(MSVC) # 4267 and 4244 are conversion/truncation warnings. We might want to fix these but they are currently pervasive. ADD_COMPILE_FLAG("/wd4267") ADD_COMPILE_FLAG("/wd4244") + # 4722 warns that destructors never return, even with WASM_NORETURN. + ADD_COMPILE_FLAG("/wd4722") ADD_COMPILE_FLAG("/WX-") ADD_DEBUG_COMPILE_FLAG("/Od") ADD_NONDEBUG_COMPILE_FLAG("/O2") ADD_COMPILE_FLAG("/D_CRT_SECURE_NO_WARNINGS") ADD_COMPILE_FLAG("/D_SCL_SECURE_NO_WARNINGS") + # Don't warn about using "strdup" as a reserved name. + ADD_COMPILE_FLAG("/D_CRT_NONSTDC_NO_DEPRECATE") ADD_NONDEBUG_COMPILE_FLAG("/UNDEBUG") # Keep asserts. # Also remove /D NDEBUG to avoid MSVC warnings about conflicting defines. diff --git a/src/s2wasm.h b/src/s2wasm.h index dd507143b..634aa43e5 100644 --- a/src/s2wasm.h +++ b/src/s2wasm.h @@ -915,7 +915,7 @@ class S2WasmBuilder { curr->align = curr->bytes; if (attributes[0]) { assert(strncmp(attributes[0], "p2align=", 8) == 0); - curr->align = 1U << getInt(attributes[0] + 8); + curr->align = Address(1) << getInt(attributes[0] + 8); } setOutput(curr, assign); }; @@ -938,7 +938,7 @@ class S2WasmBuilder { curr->align = curr->bytes; if (attributes[0]) { assert(strncmp(attributes[0], "p2align=", 8) == 0); - curr->align = 1U << getInt(attributes[0] + 8); + curr->align = Address(1) << getInt(attributes[0] + 8); } curr->value = inputs[1]; curr->finalize(); @@ -1430,7 +1430,7 @@ class S2WasmBuilder { Address localAlign = 1; if (*s == ',') { skipComma(); - localAlign = 1 << getInt(); + localAlign = Address(1) << getInt(); } linkerObj->addStatic(size, std::max(align, localAlign), name); } diff --git a/src/tools/wasm2asm.cpp b/src/tools/wasm2asm.cpp index 5c331f4c3..4198c8784 100644 --- a/src/tools/wasm2asm.cpp +++ b/src/tools/wasm2asm.cpp @@ -80,7 +80,7 @@ int main(int argc, const char *argv[]) { } catch (ParseException& p) { p.dump(std::cerr); Fatal() << "error in parsing input"; - } catch (std::bad_alloc& b) { + } catch (std::bad_alloc&) { Fatal() << "error in building module, std::bad_alloc (possibly invalid request for silly amounts of memory)"; } |