diff --git a/CMakeLists.txt b/CMakeLists.txt index 69169c42e..780ed2144 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -132,7 +132,7 @@ endif() if(CMAKE_COMPILER_IS_GNUCXX OR CLANG) # Note clang-cl is odd and sets both CLANG and MSVC. We base our configuration # primarily on our normal Clang one. - set(C_CXX_FLAGS "-Werror -Wformat=2 -Wsign-compare -Wmissing-field-initializers -Wwrite-strings -Wvla -Wshadow") + set(C_CXX_FLAGS "-Werror -Wformat=2 -Wsign-compare -Wmissing-field-initializers -Wwrite-strings -Wvla -Wshadow -Wtype-limits") if(MSVC) # clang-cl sets different default warnings than clang. It also treats -Wall # as -Weverything, to match MSVC. Instead -W3 is the alias for -Wall. diff --git a/crypto/trust_token/trust_token.c b/crypto/trust_token/trust_token.c index ccfecdbea..55785d5d3 100644 --- a/crypto/trust_token/trust_token.c +++ b/crypto/trust_token/trust_token.c @@ -626,11 +626,7 @@ static int add_cbor_int_with_type(CBB *cbb, uint8_t major_type, return CBB_add_u8(cbb, 0x1a | major_type) && CBB_add_u32(cbb, (uint32_t)value); } - if (value <= 0xffffffffffffffff) { - return CBB_add_u8(cbb, 0x1b | major_type) && CBB_add_u64(cbb, value); - } - - return 0; + return CBB_add_u8(cbb, 0x1b | major_type) && CBB_add_u64(cbb, value); } // https://tools.ietf.org/html/rfc7049#section-2.1