From dac763c782ce05476dec02e855f349d2b6f3a910 Mon Sep 17 00:00:00 2001 From: Julius Werner Date: Tue, 7 May 2019 12:56:19 -0700 Subject: Make vboot -Wtype-limits compliant -Wtype-limits is an additional warning we're trying to enable in coreboot that catches common coding mistakes (e.g. checking whether an unsigned variable is < 0). vboot almost works with this out of the box, but there's one instance where we want such a check (because the constant it's checking may change). This patch pragma's it out so that we can still build with the new warning. BRANCH=None BUG=chromium:960270 TEST=make runtests Change-Id: I678a5915c99451b7e0a2672efb5ae6c81ebfb027 Signed-off-by: Julius Werner Reviewed-on: https://chromium-review.googlesource.com/1598720 Commit-Ready: Joel Kitching Reviewed-by: Joel Kitching --- firmware/2lib/2misc.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/firmware/2lib/2misc.c b/firmware/2lib/2misc.c index 95cbae35..8b6a19f8 100644 --- a/firmware/2lib/2misc.c +++ b/firmware/2lib/2misc.c @@ -117,6 +117,9 @@ void vb2_fail(struct vb2_context *ctx, uint8_t reason, uint8_t subcode) } } +#pragma GCC diagnostic push +/* Don't warn for the version_minor check even if the checked version is 0. */ +#pragma GCC diagnostic ignored "-Wtype-limits" int vb2_init_context(struct vb2_context *ctx) { struct vb2_shared_data *sd = vb2_get_sd(ctx); @@ -152,6 +155,7 @@ int vb2_init_context(struct vb2_context *ctx) ctx->workbuf_used = vb2_wb_round_up(sizeof(*sd)); return VB2_SUCCESS; } +#pragma GCC diagnostic pop void vb2_check_recovery(struct vb2_context *ctx) { -- cgit v1.2.1