Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp7150842pxb; Thu, 18 Feb 2021 02:50:11 -0800 (PST) X-Google-Smtp-Source: ABdhPJygza8LSwEw4Ep6BPZxqK8WEAFHqS3fVvxg/Skkq294JejSwcbuLyUEFpA4u8yrN2RQQbZu X-Received: by 2002:a17:906:ad83:: with SMTP id la3mr3328755ejb.257.1613645411328; Thu, 18 Feb 2021 02:50:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613645411; cv=none; d=google.com; s=arc-20160816; b=GJX8yw/rxH4Vg+lidBAD8TRBbiJx6u6fKW3ZTk7/PNRAA4xcwvbYqxWEFeTP9rDlU4 Kq4rXQt7BfO6FQXG+bVphsk0iAMFrnTitUmNzZFtTiSnQd4JVE5Q1cZ1HFsIyrg1ff3x ODlL536zd+NZDPsj6TYaI6slznRm1ddA2Wxl0/XpYtu/J67J7pcbfut54nZpfqZkuzqN XXLkfItD7eduT4OlmaqtxNTKc29iVORR7bukZO1EqZ4WjmaLDqY5RbFL9Fjjb1XzIMy+ fMptMWDCL0Lk+ZPxJO8zmjAfawVhqK5s5DIdIkk5D5i+0HLPXnd/1OsRmXQiORDHy0rL VFwA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=jOjn1MchMQ2YDOXlOjEW8pAzIdJPhYksIyS5082U0h8=; b=K1Gd91r2ogR4zVP7m60YFkJvZELnoizOAXIF+PPBN/Gs5es0TdtZPs69VkDGuXoOjZ FiCMsaZysY0px240ssrjNp3FEFtAW3ejjjzMFCmlV91XkbT1iNMbk5RQLzTz+z3FJFVA cJBX8GFqbWf5DLX7bLqL7MxPCtxJSwFK39H468ReAEm9JMvb3QcGkSHQxD1/KcKUw2q7 1aeXFJGYrOWXFgJkMmAI9CAZoD+wvGmNU7REnBXqPyoz+pdiEB55EP1JibkW1lUJnc14 cAmgDVFWnNJYlF86gBLOY4wmRONZ871cEbv/GMBVckLULDQm0L4KS0U0VaYFiWMfGN6j c7ZQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g19si3817172ejz.742.2021.02.18.02.49.47; Thu, 18 Feb 2021 02:50:11 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231802AbhBRKpP (ORCPT + 99 others); Thu, 18 Feb 2021 05:45:15 -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