Use -Wno-frame-address alongside using -Wall and -Werror
PATCH 1/1 Use -Wno-frame-address alongside using -Wall and -Werror
Quote from https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#Warning-Options
-Wframe-address
Warn when the ‘__builtin_frame_address’ or ‘__builtin_return_address’ is called with an argument greater than 0. Such calls may return indeterminate values or crash the program. The warning is included in -Wall.
Is being inforced in GCC 6.1.x at least on POWERPC. Removing -Werror (or -Wall) is unwise and since the stacktrace code uses __builtin_return_address with a non zero argument for exactly the intentended purpose, -Wno-frame-address is the correct solution.
--- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Makefile +1 -1
@@ -45,7 +45,7 @@ cc-option = $(shell if $(CC) $(1) -S -o /dev/null -xc /dev/null \ > /dev/null 2>&1; then echo "$(1)"; else echo "$(2)"; fi ;) CFLAGS += -g -CFLAGS += $(autodepend-flags) -Wall -Werror +CFLAGS += $(autodepend-flags) -Wall -Werror -Wno-frame-address frame-pointer-flag=-f$(if $(KEEP_FRAME_POINTER),no-,)omit-frame-pointer fomit_frame_pointer := $(call cc-option, $(frame-pointer-flag), "") fnostack_protector := $(call cc-option, -fno-stack-protector, "")
Signature · 1 line
2.9.0
Quoted 34 lines · Cyril Bur
Quote from https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#Warning-Options
-Wframe-address
Warn when the ‘__builtin_frame_address’ or ‘__builtin_return_address’ is called with an argument greater than 0. Such calls may return indeterminate values or crash the program. The warning is included in -Wall.Is being inforced in GCC 6.1.x at least on POWERPC. Removing -Werror (or -Wall) is unwise and since the stacktrace code uses
__builtin_return_addresswith a non zero argument for exactly the intentended purpose, -Wno-frame-address is the correct solution.Signed-off-by Cyril Bur <[email protected]>--- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)Makefile +1
-1@@ -45,7 +45,7 @@ cc-option = $(shell if $(CC) $(1) -S -o /dev/null -xc /dev/null \ > /dev/null 2>&1; then echo "$(1)"; else echo "$(2)"; fi ;) CFLAGS += -g -CFLAGS += $(autodepend-flags) -Wall -Werror +CFLAGS += $(autodepend-flags) -Wall -Werror -Wno-frame-address frame-pointer-flag=-f$(if $(KEEP_FRAME_POINTER),no-,)omit-frame-pointer fomit_frame_pointer := $(call cc-option, $(frame-pointer-flag), "") fnostack_protector := $(call cc-option, -fno-stack-protector, "")Signature · 1 line
2.9.0
Paolo, ping?
I've updated to F24, which has later gcc, and now need to carry this patch in my local tree.
Thanks,
drew
Quoted 38 lines · Cyril Bur
Quote from https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#Warning-Options
-Wframe-address
Warn when the ‘__builtin_frame_address’ or ‘__builtin_return_address’ is called with an argument greater than 0. Such calls may return indeterminate values or crash the program. The warning is included in -Wall.Is being inforced in GCC 6.1.x at least on POWERPC. Removing -Werror (or -Wall) is unwise and since the stacktrace code uses
__builtin_return_addresswith a non zero argument for exactly the intentended purpose, -Wno-frame-address is the correct solution.Signed-off-by Cyril Bur <[email protected]>--- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)Makefile +1
-1@@ -45,7 +45,7 @@ cc-option = $(shell if $(CC) $(1) -S -o /dev/null -xc /dev/null \ > /dev/null 2>&1; then echo "$(1)"; else echo "$(2)"; fi ;) CFLAGS += -g -CFLAGS += $(autodepend-flags) -Wall -Werror +CFLAGS += $(autodepend-flags) -Wall -Werror -Wno-frame-address frame-pointer-flag=-f$(if $(KEEP_FRAME_POINTER),no-,)omit-frame-pointer fomit_frame_pointer := $(call cc-option, $(frame-pointer-flag), "") fnostack_protector := $(call cc-option, -fno-stack-protector, "")Signature · 6 lines
2.9.0 -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html