Remove tautological comparison.

Also build with -Wtype-limits to catch future instances.

Bug: 529
Change-Id: I2d84dc1824ffc7cd92411f49c9f953bcd3c74331
Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/55045
Reviewed-by: Adam Langley <agl@google.com>
Commit-Queue: Adam Langley <agl@google.com>
Commit-Queue: David Benjamin <davidben@google.com>
Auto-Submit: David Benjamin <davidben@google.com>
fips-20230428
David Benjamin 2 years ago committed by Boringssl LUCI CQ
parent 045129c80c
commit fd4315d8eb
  1. 2
      CMakeLists.txt
  2. 4
      crypto/trust_token/trust_token.c

@ -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.

@ -626,13 +626,9 @@ 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;
}
// https://tools.ietf.org/html/rfc7049#section-2.1
static int add_cbor_int(CBB *cbb, uint64_t value) {
return add_cbor_int_with_type(cbb, 0, value);

Loading…
Cancel
Save