Patrick Georgi has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/32814
Change subject: build system: Add various compiler flags that enable warnings on UB ......................................................................
build system: Add various compiler flags that enable warnings on UB
Some types of Undefined Behavior can be determined statically at compile time and gcc now has a set of flags that make it emit warnings in that case instead of doing the __builtin_trap() / optimize / UD2-opcode dance that silently breaks the resulting binary.
Change-Id: I3aa5ca00c9838cc7517160069310a1ef85372027 Signed-off-by: Patrick Georgi pgeorgi@google.com --- M Makefile.inc 1 file changed, 2 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/14/32814/1
diff --git a/Makefile.inc b/Makefile.inc index 9860da1..f2e010c 100644 --- a/Makefile.inc +++ b/Makefile.inc @@ -410,6 +410,8 @@ ifeq ($(CCC_ANALYZER_OUTPUT_FORMAT),) CFLAGS_common += -Wno-packed-not-aligned CFLAGS_common += -fconserve-stack +CFLAGS_common += -pedantic-errors -Wnull-dereference +CFLAGS_common += -Wno-aggressive-loop-optimizations -Wreturn-type # cf. commit f69a99db (coreboot: x86: enable gc-sections) CFLAGS_common += -Wno-unused-but-set-variable endif
Hello Martin Roth,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/32814
to look at the new patch set (#2).
Change subject: build system: Add various compiler flags that enable warnings on UB ......................................................................
build system: Add various compiler flags that enable warnings on UB
Some types of Undefined Behavior can be determined statically at compile time and gcc now has a set of flags that make it emit warnings in that case instead of doing the __builtin_trap() / optimize / UD2-opcode dance that silently breaks the resulting binary.
BUG=chromium:958270 BRANCH=none TEST=abuild passes (probably not)
Change-Id: I3aa5ca00c9838cc7517160069310a1ef85372027 Signed-off-by: Patrick Georgi pgeorgi@google.com --- M Makefile.inc 1 file changed, 2 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/14/32814/2
Aaron Durbin has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/32814 )
Change subject: build system: Add various compiler flags that enable warnings on UB ......................................................................
Patch Set 2: Code-Review+2
Hello Aaron Durbin, build bot (Jenkins), Martin Roth,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/32814
to look at the new patch set (#3).
Change subject: build system: Add various compiler flags that enable warnings on UB ......................................................................
build system: Add various compiler flags that enable warnings on UB
Some types of Undefined Behavior can be determined statically at compile time and gcc now has a set of flags that make it emit warnings in that case instead of doing the __builtin_trap() / optimize / UD2-opcode dance that silently breaks the resulting binary.
BUG=chromium:958270 BRANCH=none TEST=abuild passes (probably not)
Change-Id: I3aa5ca00c9838cc7517160069310a1ef85372027 Signed-off-by: Patrick Georgi pgeorgi@google.com --- M Makefile.inc 1 file changed, 2 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/14/32814/3
Hello Aaron Durbin, build bot (Jenkins), Martin Roth,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/32814
to look at the new patch set (#4).
Change subject: build system: Add various compiler flags that enable warnings on UB ......................................................................
build system: Add various compiler flags that enable warnings on UB
Some types of Undefined Behavior can be determined statically at compile time and gcc now has a set of flags that make it emit warnings in that case instead of doing the __builtin_trap() / optimize / UD2-opcode dance that silently breaks the resulting binary.
BUG=chromium:958270 BRANCH=none TEST=abuild passes (probably not)
Change-Id: I3aa5ca00c9838cc7517160069310a1ef85372027 Signed-off-by: Patrick Georgi pgeorgi@google.com --- M Makefile.inc 1 file changed, 1 insertion(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/14/32814/4
Aaron Durbin has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/32814 )
Change subject: build system: Add various compiler flags that enable warnings on UB ......................................................................
Patch Set 4: Code-Review+2
Patrick Georgi has submitted this change. ( https://review.coreboot.org/c/coreboot/+/32814 )
Change subject: build system: Add various compiler flags that enable warnings on UB ......................................................................
build system: Add various compiler flags that enable warnings on UB
Some types of Undefined Behavior can be determined statically at compile time and gcc now has a set of flags that make it emit warnings in that case instead of doing the __builtin_trap() / optimize / UD2-opcode dance that silently breaks the resulting binary.
BUG=chromium:958270 BRANCH=none TEST=abuild passes (probably not)
Change-Id: I3aa5ca00c9838cc7517160069310a1ef85372027 Signed-off-by: Patrick Georgi pgeorgi@google.com Reviewed-on: https://review.coreboot.org/c/coreboot/+/32814 Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Aaron Durbin adurbin@chromium.org --- M Makefile.inc 1 file changed, 1 insertion(+), 0 deletions(-)
Approvals: build bot (Jenkins): Verified Aaron Durbin: Looks good to me, approved
diff --git a/Makefile.inc b/Makefile.inc index d3aa885..66144cd 100644 --- a/Makefile.inc +++ b/Makefile.inc @@ -419,6 +419,7 @@ ifeq ($(CCC_ANALYZER_OUTPUT_FORMAT),) CFLAGS_common += -Wno-packed-not-aligned CFLAGS_common += -fconserve-stack +CFLAGS_common += -Wnull-dereference -Wreturn-type # cf. commit f69a99db (coreboot: x86: enable gc-sections) CFLAGS_common += -Wno-unused-but-set-variable endif