From a5afd01feb0b4b45adbcd8ab38ab8a2ef2a2ef67 Mon Sep 17 00:00:00 2001 From: Julius Werner Date: Thu, 8 Aug 2019 11:02:44 -0700 Subject: Minor fixes for clang We want to switch over from GCC to clang for userspace utilities. It comes with a new default warning that we happen to trigger, so silence that. It also comes with a dumb reachability checker that can't tell when the use of one variable is guarded by another, so need to unnecessarily initialize a variable in load_kernel_test. BRANCH=none BUG=chromium:991812 TEST=Built for Kevin with clang. Change-Id: If9fc391ade0243aea1cae8d682e31390dc082f77 Signed-off-by: Julius Werner Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1744667 Reviewed-by: Manoj Gupta Reviewed-by: Joel Kitching --- Makefile | 3 ++- utility/load_kernel_test.c | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 4c051357..708d490a 100644 --- a/Makefile +++ b/Makefile @@ -140,7 +140,8 @@ WERROR := -Werror FIRMWARE_FLAGS := -nostdinc -ffreestanding -fno-builtin -fno-stack-protector COMMON_FLAGS := -pipe ${WERROR} -Wall -Wstrict-prototypes -Wtype-limits \ -Wundef -Wmissing-prototypes -Wno-trigraphs -Wredundant-decls \ - -Wwrite-strings -Wstrict-aliasing -Wshadow -Wdate-time ${DEBUG_FLAGS} + -Wwrite-strings -Wstrict-aliasing -Wshadow -Wdate-time \ + -Wno-address-of-packed-member ${DEBUG_FLAGS} # Note: FIRMWARE_ARCH is defined by the Chromium OS ebuild. ifeq (${FIRMWARE_ARCH}, arm) diff --git a/utility/load_kernel_test.c b/utility/load_kernel_test.c index 2fbf0c54..fe73fa8b 100644 --- a/utility/load_kernel_test.c +++ b/utility/load_kernel_test.c @@ -82,7 +82,7 @@ vb2_error_t VbExDiskWrite(VbExDiskHandle_t handle, uint64_t lba_start, int main(int argc, char* argv[]) { const char* image_name; - uint64_t key_size; + uint64_t key_size = 0; uint8_t* key_blob = NULL; VbSharedDataHeader* shared; struct vb2_gbb_header* gbb; -- cgit v1.2.1