[coreboot-gerrit] Patch merged into coreboot/master: cbfstool: Fix build error with clang when comparing enum

gerrit at coreboot.org gerrit at coreboot.org
Fri Nov 20 05:36:50 CET 2015


the following patch was just integrated into master:
commit 37450ff5343ffa3326a3f23a8ae7448d48e14e3c
Author: zbao <fishbaozi at gmail.com>
Date:   Thu Nov 5 14:35:57 2015 +0800

    cbfstool: Fix build error with clang when comparing enum
    
    If HOSTCC=clang, the -Wtautological-constant-out-of-range-compare is
    set automaticaaly. That assume the value of type enum is in the defined
    range. Then testing if a type enum is out of range causes build error.
    
    Error:
    coreboot/util/cbfstool/cbfs_image.c:1387:16: error:
     comparison of constant 4 with expression of type 'enum vb2_hash_algorithm'
     is always false [-Werror,-Wtautological-constant-out-of-range-compare]
     if (hash_type >= CBFS_NUM_SUPPORTED_HASHES)
        ~~~~~~~~~ ^  ~~~~~~~~~~~~~~~~~~~~~~~~~
    1 error generated.
    
    clang version:
    FreeBSD clang version 3.4.1 (tags/RELEASE_34/dot1-final 208032) 20140512
    Target: x86_64-unknown-freebsd10.2
    Thread model: posix
    
    Change-Id: I3e1722bf6f9553793a9f0c7f4e790706b6938522
    Signed-off-by: zbao <fishbaozi at gmail.com>
    Reviewed-on: http://review.coreboot.org/12330
    Tested-by: build bot (Jenkins)
    Reviewed-by: Martin Roth <martinroth at google.com>


See http://review.coreboot.org/12330 for details.

-gerrit



More information about the coreboot-gerrit mailing list