add_compile_options("$<$<CXX_COMPILER_ID:MSVC>:/w34703>")
# Warn about different indirection types.
add_compile_options("$<$<CXX_COMPILER_ID:MSVC>:/w34057>")
+ # Warn about signed/unsigned mismatch.
+ add_compile_options("$<$<CXX_COMPILER_ID:MSVC>:/w34245>")
endif()
if(NOT WIN32)
unsigned id = insn.word(2);
unsigned type = insn.word(1);
- int location = value_or_default(var_locations, id, -1);
- int builtin = value_or_default(var_builtins, id, -1);
+ int location = value_or_default(var_locations, id, static_cast<unsigned>(-1));
+ int builtin = value_or_default(var_builtins, id, static_cast<unsigned>(-1));
unsigned component = value_or_default(var_components, id, 0); // Unspecified is OK, is 0
bool is_patch = var_patch.find(id) != var_patch.end();
bool is_relaxed_precision = var_relaxed_precision.find(id) != var_relaxed_precision.end();
if (arg == "--device-index" || arg == "-d") {
int result = sscanf(arg2.c_str(), "%u", &options->device_index);
if (result != 1) {
- options->device_index = -1;
+ options->device_index = static_cast<uint32_t>(-1);
std::cerr << "Unable to parse index: " << arg2 << std::endl;
return false;
}