From: Cyril Bur Subject: [kvm-unit-tests PATCH] Use -Wno-frame-address alongside using -Wall and -Werror Date: Thu, 23 Jun 2016 17:01:01 +1000 Message-ID: <20160623070101.15497-1-cyrilbur@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: QUOTED-PRINTABLE To: kvm@vger.kernel.org Return-path: Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:47758 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751479AbcFWHCG (ORCPT ); Thu, 23 Jun 2016 03:02:06 -0400 Received: from pps.filterd (m0098404.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.11/8.16.0.11) with SMTP id u5N6wRK8091791 for ; Thu, 23 Jun 2016 03:02:04 -0400 Received: from e23smtp06.au.ibm.com (e23smtp06.au.ibm.com [202.81.31.148]) by mx0a-001b2d01.pphosted.com with ESMTP id 23qaefnccu-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Thu, 23 Jun 2016 03:02:00 -0400 Received: from localhost by e23smtp06.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 23 Jun 2016 17:01:20 +1000 Received: from d23relay10.au.ibm.com (d23relay10.au.ibm.com [9.190.26.77]) by d23dlp01.au.ibm.com (Postfix) with ESMTP id 8D65E2CE8059 for ; Thu, 23 Jun 2016 17:01:18 +1000 (EST) Received: from d23av06.au.ibm.com (d23av06.au.ibm.com [9.190.235.151]) by d23relay10.au.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id u5N71I9e46399700 for ; Thu, 23 Jun 2016 17:01:18 +1000 Received: from d23av06.au.ibm.com (localhost [127.0.0.1]) by d23av06.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id u5N71IlA014963 for ; Thu, 23 Jun 2016 17:01:18 +1000 Received: from ozlabs.au.ibm.com (ozlabs.au.ibm.com [9.192.253.14]) by d23av06.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id u5N71INY014951 for ; Thu, 23 Jun 2016 17:01:18 +1000 Received: from camb691.ozlabs.ibm.com (haven.au.ibm.com [9.192.254.114]) (using TLSv1.2 with cipher DHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ozlabs.au.ibm.com (Postfix) with ESMTPSA id 97CDFA026F for ; Thu, 23 Jun 2016 17:01:17 +1000 (AEST) Sender: kvm-owner@vger.kernel.org List-ID: Quote from https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#Warn= ing-Options -Wframe-address Warn when the =E2=80=98__builtin_frame_address=E2=80=99 or =E2=80=98_= _builtin_return_address=E2=80=99 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. Signed-off-by: Cyril Bur --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index bed6ed3..0ffe234 100644 --- a/Makefile +++ b/Makefile @@ -45,7 +45,7 @@ cc-option =3D $(shell if $(CC) $(1) -S -o /dev/null -= xc /dev/null \ > /dev/null 2>&1; then echo "$(1)"; else echo "$(2)"; fi= ;) =20 CFLAGS +=3D -g -CFLAGS +=3D $(autodepend-flags) -Wall -Werror +CFLAGS +=3D $(autodepend-flags) -Wall -Werror -Wno-frame-address frame-pointer-flag=3D-f$(if $(KEEP_FRAME_POINTER),no-,)omit-frame-poin= ter fomit_frame_pointer :=3D $(call cc-option, $(frame-pointer-flag), "") fnostack_protector :=3D $(call cc-option, -fno-stack-protector, "") --=20 2.9.0