Received: by 10.213.65.68 with SMTP id h4csp138960imn; Thu, 15 Mar 2018 20:34:30 -0700 (PDT) X-Google-Smtp-Source: AG47ELuz/ID8v/8lCd/SvPRhOIF1Z0zMNF9VMmnwPOsHD3bbn2/bntz6n/Z6KRtMkfkuUVHOaKR/ X-Received: by 10.98.65.198 with SMTP id g67mr251513pfd.127.1521171270068; Thu, 15 Mar 2018 20:34:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521171270; cv=none; d=google.com; s=arc-20160816; b=MXqrzKcvyQ3YnjlqoepwxKcVJkcmO+xkHwloMiy8x2qB4pSjcmELBvH44ep0euv4CM L1uq+T8HAD3cW6mzzj1BSkY3F6pF7HVIJmFmold3HZJMuo58pnOMOJM2DkLTdvQtRfTk gzdRoedVBo93GOZpe7ZcEmadKM5yo6M9vvueYRMjBMpAlfhufcebhz3YIpdC+/+pU14U d2F7MlteThMuPUdDgtq376OXCHgq2i63svA/Sv+pHOAG8V3kUE/AGS0LSv0ZLvIP5gXF I99sc3EiyORtdmp8yI621xNBv1u3jARfB4Cl/vZvQ4rXg9NBQ+0hDEvLNbYU6eQG0+A1 79Tg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date :arc-authentication-results; bh=91cF2t0eZEbVv/gGq1ctWG3TxarC/2jqi5KvQ6QlOdU=; b=Nw2W6HhJbUqI0bSa8S8Exf7SHTMO6yEf60vslMAs8thMoBFTRSbsv+NpuehzBHb/7C PSK1AtdShDLlTaH91KEkG3jmdNKKD4/bX4zX/+KSu/Bb+Rb2QGKn/+14pRPu7nxf1Ss8 egeGxkQC4XSsBeGqW8oiP2SESJwh+BtgGAIZX3bOJ7edEt5bGvcOCGPimpQ/+4boFsk8 fghVLghjY35kCV/fgvwpLlWC3qWEDqHva5YdQ1PuMNqqx+Y5dDB/HsRKY4TMxN1McoGu 3CwCTpaOfu8igyPPL840BQDsYgmCJ9SRIRh8geUtpGny4DZU67249K6YXZ2is5itIS2l 0K+Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d69si4366550pgc.60.2018.03.15.20.34.15; Thu, 15 Mar 2018 20:34:30 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932785AbeCPDL7 (ORCPT + 99 others); Thu, 15 Mar 2018 23:11:59 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:36110 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932548AbeCPDLz (ORCPT ); Thu, 15 Mar 2018 23:11:55 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 2B594406802E; Fri, 16 Mar 2018 03:11:55 +0000 (UTC) Received: from treble (ovpn-122-218.rdu2.redhat.com [10.10.122.218]) by smtp.corp.redhat.com (Postfix) with ESMTP id 531751256F7E; Fri, 16 Mar 2018 03:11:54 +0000 (UTC) Date: Thu, 15 Mar 2018 22:11:54 -0500 From: Josh Poimboeuf To: Laura Abbott Cc: Arnaldo Carvalho de Melo , Adrian Hunter , Jiri Olsa , Namhyung Kim , Wang Nan , Linux Kernel Mailing List Subject: Re: New -Werror=restrict error with incremental gcc Message-ID: <20180316031154.juk2uncs7baffctp@treble> References: <34478c69-e238-90db-bf1e-9622a060c778@redhat.com> <20180315143012.GA2221@redhat.com> <53714ddf-1b2d-295b-e364-3330f1d9c48c@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <53714ddf-1b2d-295b-e364-3330f1d9c48c@redhat.com> User-Agent: Mutt/1.6.0.1 (2016-04-01) X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Fri, 16 Mar 2018 03:11:55 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Fri, 16 Mar 2018 03:11:55 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'jpoimboe@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Mar 15, 2018 at 08:06:26AM -0700, Laura Abbott wrote: > This only showed up with the very latest rawhide snapshot, .17 worked and > .18 started failing. I had to download .18 manually to test locally > https://koji.fedoraproject.org/koji/packageinfo?packageID=40 I also see the error with the latest gcc master branch. The code is harmless, but maybe the warning is useful in other places, so here's one way to fix it. ---- From: Josh Poimboeuf Subject: [PATCH] objtool, perf: Fix GCC 8 -Wrestrict error Starting with recent GCC 8 builds, objtool and perf fail to build with the following error: ../str_error_r.c: In function ‘str_error_r’: ../str_error_r.c:25:3: error: passing argument 1 to restrict-qualified parameter aliases with argument 5 [-Werror=restrict] snprintf(buf, buflen, "INTERNAL ERROR: strerror_r(%d, %p, %zd)=%d", errnum, buf, buflen, err); The code seems harmless, but there's probably no benefit in printing the 'buf' pointer in this situation anyway, so just remove it to make GCC happy. Signed-off-by: Josh Poimboeuf --- tools/lib/str_error_r.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/lib/str_error_r.c b/tools/lib/str_error_r.c index d6d65537b0d9..6aad8308a0ac 100644 --- a/tools/lib/str_error_r.c +++ b/tools/lib/str_error_r.c @@ -22,6 +22,6 @@ char *str_error_r(int errnum, char *buf, size_t buflen) { int err = strerror_r(errnum, buf, buflen); if (err) - snprintf(buf, buflen, "INTERNAL ERROR: strerror_r(%d, %p, %zd)=%d", errnum, buf, buflen, err); + snprintf(buf, buflen, "INTERNAL ERROR: strerror_r(%d, [buf], %zd)=%d", errnum, buflen, err); return buf; } -- 2.14.3