From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,MAILING_LIST_MULTI, NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B0297C43332 for ; Thu, 18 Feb 2021 10:50:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6F45264E2F for ; Thu, 18 Feb 2021 10:50:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231934AbhBRKpn (ORCPT ); Thu, 18 Feb 2021 05:45:43 -0500 Received: from frasgout.his.huawei.com ([185.176.79.56]:2582 "EHLO frasgout.his.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231628AbhBRJ2x (ORCPT ); Thu, 18 Feb 2021 04:28:53 -0500 Received: from fraeml745-chm.china.huawei.com (unknown [172.18.147.226]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4Dh8Md3t2Sz67q3h; Thu, 18 Feb 2021 17:21:01 +0800 (CST) Received: from lhreml724-chm.china.huawei.com (10.201.108.75) by fraeml745-chm.china.huawei.com (10.206.15.226) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2; Thu, 18 Feb 2021 10:28:01 +0100 Received: from [10.210.168.96] (10.210.168.96) by lhreml724-chm.china.huawei.com (10.201.108.75) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2; Thu, 18 Feb 2021 09:27:59 +0000 Subject: Re: [PATCH v5] perf tools: Fix arm64 build error with gcc-11 To: Jianlin Lv , , , , , , , , , , , , , , , , , , CC: , , , , References: <20210218031245.2078492-1-Jianlin.Lv@arm.com> From: John Garry Message-ID: Date: Thu, 18 Feb 2021 09:26:17 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.1.2 MIME-Version: 1.0 In-Reply-To: <20210218031245.2078492-1-Jianlin.Lv@arm.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-Originating-IP: [10.210.168.96] X-ClientProxiedBy: lhreml720-chm.china.huawei.com (10.201.108.71) To lhreml724-chm.china.huawei.com (10.201.108.75) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 18/02/2021 03:12, Jianlin Lv wrote: > gcc version: 11.0.0 20210208 (experimental) (GCC) > > Following build error on arm64: > > ....... > In function ‘printf’, > inlined from ‘regs_dump__printf’ at util/session.c:1141:3, > inlined from ‘regs__printf’ at util/session.c:1169:2: > /usr/include/aarch64-linux-gnu/bits/stdio2.h:107:10: \ > error: ‘%-5s’ directive argument is null [-Werror=format-overflow=] > > 107 | return __printf_chk (__USE_FORTIFY_LEVEL - 1, __fmt, \ > __va_arg_pack ()); > > ...... > In function ‘fprintf’, > inlined from ‘perf_sample__fprintf_regs.isra’ at \ > builtin-script.c:622:14: > /usr/include/aarch64-linux-gnu/bits/stdio2.h:100:10: \ > error: ‘%5s’ directive argument is null [-Werror=format-overflow=] > 100 | return __fprintf_chk (__stream, __USE_FORTIFY_LEVEL - 1, __fmt, > 101 | __va_arg_pack ()); > > cc1: all warnings being treated as errors > ....... > > This patch fixes Wformat-overflow warnings. Add helper function to > convert NULL to "unknown". > > Signed-off-by: Jianlin Lv thanks Reviewed-by: John Garry