Skip to content

Commit bdb14b6

Browse files
authored
spirv-val: fix another C4146 warning (KhronosGroup#6289)
Required to pass -Werror for DXC+MSVC
1 parent f6940d2 commit bdb14b6

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

source/val/validate_conversion.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414

1515
// Validates correctness of conversion instructions.
1616

17+
#include <climits>
18+
1719
#include "source/opcode.h"
1820
#include "source/spirv_constant.h"
1921
#include "source/spirv_target_env.h"
@@ -715,7 +717,7 @@ spv_result_t ConversionPass(ValidationState_t& _, const Instruction* inst) {
715717
unsigned res_arr_len_id = result_type_inst->GetOperandAs<unsigned>(2u);
716718

717719
// Are the input and result element types compatible?
718-
unsigned src_arr_len = -1u, res_arr_len = -1u;
720+
unsigned src_arr_len = UINT_MAX, res_arr_len = UINT_MAX;
719721
bool src_arr_len_status =
720722
_.GetConstantValueAs<unsigned>(src_arr_len_id, src_arr_len);
721723
bool res_arr_len_status =

0 commit comments

Comments
 (0)