[coreboot-gerrit] Patch set updated for coreboot: d820c5e cbfstool/cbfs_image.c: Compare only signed integers
Paul Menzel (paulepanter@users.sourceforge.net)
gerrit at coreboot.org
Sun Apr 26 22:44:26 CEST 2015
Paul Menzel (paulepanter at users.sourceforge.net) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/9995
-gerrit
commit d820c5e6017343288efe2b979a802753c44fd8bd
Author: Paul Menzel <paulepanter at users.sourceforge.net>
Date: Sat Apr 25 21:29:10 2015 +0200
cbfstool/cbfs_image.c: Compare only signed integers
Fix up commit 0e53931f (cbfstool: Clean up in preparation for adding
new files) enabling extra warnings for building *cbfstool*, which also
enables the warning *sign-compare* [1].
> Warn when a comparison between signed and unsigned values could
> produce an incorrect result when the signed value is converted to
> unsigned.
As warnings are treated as errors, building *cbfstool* fails now with
the following error.
cbfs_image.c: In function ‘cbfs_add_entry_at’:
cbfs_image.c:451:66: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
assert((int)((char*)CBFS_SUBHEADER(entry) - image->buffer.data) ==
Fix this by casting the unsigned part to a signed integer.
[1] https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html
Change-Id: I2634a0004cd46da7fcfe5301221c7099258befe6
Signed-off-by: Paul Menzel <paulepanter at users.sourceforge.net>
---
util/cbfstool/cbfs_image.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/util/cbfstool/cbfs_image.c b/util/cbfstool/cbfs_image.c
index e61664c..cdc630d 100644
--- a/util/cbfstool/cbfs_image.c
+++ b/util/cbfstool/cbfs_image.c
@@ -449,7 +449,7 @@ static int cbfs_add_entry_at(struct cbfs_image *image,
content_offset, (int)((char*)CBFS_SUBHEADER(entry) -
image->buffer.data));
assert((char*)CBFS_SUBHEADER(entry) - image->buffer.data ==
- content_offset);
+ (int)content_offset);
memcpy(CBFS_SUBHEADER(entry), data, size);
if (verbose > 1) cbfs_print_entry_info(image, entry, stderr);
More information about the coreboot-gerrit
mailing list