Julius Werner has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/32536
Change subject: WIP: enable -Wtype-limits ......................................................................
WIP: enable -Wtype-limits
DO NOT REVIEW (yet)
Change-Id: I19edabfd092d09dad720e3fc47b44838163bfe25 Signed-off-by: Julius Werner jwerner@chromium.org --- M Makefile.inc 1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/36/32536/1
diff --git a/Makefile.inc b/Makefile.inc index fc04a16..d38cd88 100644 --- a/Makefile.inc +++ b/Makefile.inc @@ -404,7 +404,7 @@ CFLAGS_common += -pipe -g -nostdinc -std=gnu11 CFLAGS_common += -nostdlib -Wall -Wundef -Wstrict-prototypes -Wmissing-prototypes CFLAGS_common += -Wwrite-strings -Wredundant-decls -Wno-trigraphs -CFLAGS_common += -Wstrict-aliasing -Wshadow -Wdate-time +CFLAGS_common += -Wstrict-aliasing -Wshadow -Wdate-time -Wtype-limits CFLAGS_common += -fno-common -ffreestanding -fno-builtin -fomit-frame-pointer CFLAGS_common += -ffunction-sections -fdata-sections -fno-pie ifeq ($(CONFIG_COMPILER_GCC),y)
Paul Menzel has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/32536 )
Change subject: Makefile.inc: Enable -Wtype-limits ......................................................................
Patch Set 9: Code-Review+1
Furquan Shaikh has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/32536 )
Change subject: Makefile.inc: Enable -Wtype-limits ......................................................................
Patch Set 9: Code-Review+2
Patrick Georgi has submitted this change and it was merged. ( https://review.coreboot.org/c/coreboot/+/32536 )
Change subject: Makefile.inc: Enable -Wtype-limits ......................................................................
Makefile.inc: Enable -Wtype-limits
This patch enables -Wtype-limits for the whole repository, which disallows checking for a condition that must be always true or always false based on type width (e.g. checking whether an unsigned variable is negative or whether a 32-bit integer is larger than 4G). This helps avoid easy to make and hard to find (because they often only affect error paths) mistakes like
size_t size = fmap_read_area(...); if (size < 0) die("If only the compiler could've told me to use ssize_t instead");
Change-Id: I19edabfd092d09dad720e3fc47b44838163bfe25 Signed-off-by: Julius Werner jwerner@chromium.org Reviewed-on: https://review.coreboot.org/c/coreboot/+/32536 Reviewed-by: Paul Menzel paulepanter@users.sourceforge.net Reviewed-by: Furquan Shaikh furquan@google.com Tested-by: build bot (Jenkins) no-reply@coreboot.org --- M Makefile.inc 1 file changed, 1 insertion(+), 1 deletion(-)
Approvals: build bot (Jenkins): Verified Paul Menzel: Looks good to me, but someone else must approve Furquan Shaikh: Looks good to me, approved
diff --git a/Makefile.inc b/Makefile.inc index a9aaaed..9860da1 100644 --- a/Makefile.inc +++ b/Makefile.inc @@ -401,7 +401,7 @@ CFLAGS_common += -pipe -g -nostdinc -std=gnu11 CFLAGS_common += -nostdlib -Wall -Wundef -Wstrict-prototypes -Wmissing-prototypes CFLAGS_common += -Wwrite-strings -Wredundant-decls -Wno-trigraphs -CFLAGS_common += -Wstrict-aliasing -Wshadow -Wdate-time +CFLAGS_common += -Wstrict-aliasing -Wshadow -Wdate-time -Wtype-limits CFLAGS_common += -fno-common -ffreestanding -fno-builtin -fomit-frame-pointer CFLAGS_common += -ffunction-sections -fdata-sections -fno-pie ifeq ($(CONFIG_COMPILER_GCC),y)
Patrick Georgi has created a revert of this change. ( https://review.coreboot.org/c/coreboot/+/32536 )
Change subject: Makefile.inc: Enable -Wtype-limits ......................................................................