Received: by 10.213.65.68 with SMTP id h4csp12823imn; Thu, 15 Mar 2018 08:08:55 -0700 (PDT) X-Google-Smtp-Source: AG47ELtUENqmVW9xsblRnmuRTZlv1SdGb5UIf4GP96jCMKfW0Uw1QcYJloQPjwN0atKSuxI1uYww X-Received: by 10.99.164.81 with SMTP id c17mr7066766pgp.114.1521126535427; Thu, 15 Mar 2018 08:08:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521126535; cv=none; d=google.com; s=arc-20160816; b=ek9RC2Hl+ldwtN3ppehv6E19CR0MxEx3rH3AzNLK6Rfy3gOXxMazy7d2igc9EbGtiX xhuObFqWxWBR4RB/AqCIY3j0SLYFiIQjF4a1GpIs4esU52CmumPH4k8v1WrvHu0JIDUS pyvG1ZPgc1QfaW5DrSN+T3UTyTBwL3xyMrtlmV5wmEsODFTcSmPAmzCwdZRKC0CGzvcB yuYVcKNAbDyevLag+LqkUqbLyxzX1UdCSCowaVN6oi6NtzhwyTDrcf/3DzjSvTf0Phdt 0cIvVkZd8/C32hh206WKuZ3YdXKTP47lF5bUCvbn346EtAUt2v1bfvhqPbmkPh2aUjpg CozQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=+LFgafKvrYetPWYODjN5T8cFYFUQloLnjjrCoDMdVSo=; b=CELnCdjsGP/8hT87i+Rr4OuoMgJOBTiJLAX1pUf3JOT67uwLR0FJRTfmRkmXONcHiG 8rtGC2Yi65rQt8XeZx+/QBQ7Idy5WvvCZiXohQqGwQw8OaKGkoYh49zbNTvQY9k1XcQK c5CIQBgT5em+/XOzjnhukmuDVV30EUc9I32S5kAUeCrqC4n/roMUO/zUKwqshXdvj+mV H54YntE6CmguxeTT/ekq7IefPJc+TzadTHTMF+tbFHSnsABCT+m3jWtG5UnzyKloolvf C9spt1mBqIKoLJ1cmXKg5/Qx3ErrIwoPzvXideeneNbpi/pw049JvUQoiclg2NKShHBb WaZg== 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 q3-v6si4140106plb.221.2018.03.15.08.08.41; Thu, 15 Mar 2018 08:08:55 -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 S1752782AbeCOPGc (ORCPT + 99 others); Thu, 15 Mar 2018 11:06:32 -0400 Received: from mail-ot0-f173.google.com ([74.125.82.173]:42755 "EHLO mail-ot0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752641AbeCOPGb (ORCPT ); Thu, 15 Mar 2018 11:06:31 -0400 Received: by mail-ot0-f173.google.com with SMTP id l5-v6so7170164otf.9 for ; Thu, 15 Mar 2018 08:06:30 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=+LFgafKvrYetPWYODjN5T8cFYFUQloLnjjrCoDMdVSo=; b=qjvtMllAJ0u6ALba61MU0ixgG9QRM6RWCbBl4EvQ8tst1K8iRHNPbpgpZj5yawK9LW K3wWZKyHsWsGCbgVk476rPcihBMq6XjZYYd1rUIxQc44WZ5v7VUQN6vuc2m1SzgHy0xm 5tN8JQzFS0PNULpkoTdHQWyC2JXTJjvQGAJMWte6ixxNXHBOJxxnvZHwUFlRptcignop poX+UFiyaSOwCeYfBz/G7kbDCSCN68hJupfQUvFZBNKfPhIf6CRywB3tKTkHM2UX7zGh A6Hh6TKzdHP/hUxGLvjF2Gzoj7LnRm9SqsiCd8NZMSNYgakP0/JznBJXT9pjtJ8lU93h CUWg== X-Gm-Message-State: AElRT7GX3dHrR+Gzmu8izHTwAPoRj7J1GUMc1Ai/qxtnmm9ZtwcvTASI BNvW0lHIzlC9xK4SbW6oDMOy1fTreco= X-Received: by 10.157.38.104 with SMTP id a95mr2233366otb.106.1521126389714; Thu, 15 Mar 2018 08:06:29 -0700 (PDT) Received: from ?IPv6:2601:602:9802:a8dc::b761? ([2601:602:9802:a8dc::b761]) by smtp.gmail.com with ESMTPSA id 24sm2732524oin.19.2018.03.15.08.06.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 15 Mar 2018 08:06:28 -0700 (PDT) Subject: Re: New -Werror=restrict error with incremental gcc To: Arnaldo Carvalho de Melo Cc: Adrian Hunter , Jiri Olsa , Namhyung Kim , Wang Nan , Josh Poimboeuf , Linux Kernel Mailing List References: <34478c69-e238-90db-bf1e-9622a060c778@redhat.com> <20180315143012.GA2221@redhat.com> From: Laura Abbott Message-ID: <53714ddf-1b2d-295b-e364-3330f1d9c48c@redhat.com> Date: Thu, 15 Mar 2018 08:06:26 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <20180315143012.GA2221@redhat.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 03/15/2018 07:30 AM, Arnaldo Carvalho de Melo wrote: > Em Wed, Mar 14, 2018 at 02:19:41PM -0700, Laura Abbott escreveu: >> Hi, >> >> Fedora picked up a new gcc (8.0.1-0.18.fc29) and it seems to have introduced a new error: >> >> gcc -Wp,-MD,/home/labbott/linux/tools/objtool/.str_error_r.o.d -Wp,-MT,/home/labbott/linux/tools/objtool/str_error_r.o -Wall -Werror -Wbad-function-cast -Wdeclaration-after-statement -Wformat-security -Wformat-y2k -Winit-self -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wno-system-headers -Wold-style-definition -Wpacked -Wredundant-decls -Wshadow -Wstrict-prototypes -Wswitch-default -Wswitch-enum -Wundef -Wwrite-strings -Wformat -Wstrict-aliasing=3 -Wno-switch-default -Wno-switch-enum -Wno-packed -fomit-frame-pointer -O2 -g -I/home/labbott/linux/tools/include -I/home/labbott/linux/tools/arch/x86/include/uapi -I/home/labbott/linux/tools/objtool/arch/x86/include -I/home/labbott/linux/tools/lib -D"BUILD_STR(s)=#s" -c -o /home/labbott/linux/tools/objtool/str_error_r.o ../lib/str_error_r.c >> ../lib/str_error_r.c: In function ‘str_error_r’: >> ../lib/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); >> ^~ >> >> This looks like gcc is now warning about the aliasing from printing out buf >> while printing to the buffer. I can work around this pretty easily but I >> know people have strong opinions about gcc warnings. Any thoughts? > > I couldn't reproduce it here: > > [perfbuilder@b34646cdb12b perf]$ gcc -v > Using built-in specs. > COLLECT_GCC=gcc > COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/8/lto-wrapper > OFFLOAD_TARGET_NAMES=nvptx-none > OFFLOAD_TARGET_DEFAULT=1 > Target: x86_64-redhat-linux > Configured with: ../configure --enable-bootstrap > --enable-languages=c,c++,objc,obj-c++,fortran,ada,go,lto --prefix=/usr > --mandir=/usr/share/man --infodir=/usr/share/info > --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-shared > --enable-threads=posix --enable-checking=release --enable-multilib > --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions > --enable-gnu-unique-object --enable-linker-build-id > --with-gcc-major-version-only --with-linker-hash-style=gnu > --enable-plugin --enable-initfini-array --with-isl --enable-libmpx > --enable-offload-targets=nvptx-none --without-cuda-driver > --enable-gnu-indirect-function --with-tune=generic --with-arch_32=i686 > --build=x86_64-redhat-linux > Thread model: posix > gcc version 8.0.1 20180310 (Red Hat 8.0.1-0.17) (GCC) > [perfbuilder@b34646cdb12b perf]$ rpm -q gcc > gcc-8.0.1-0.17.fc29.x86_64 > [perfbuilder@b34646cdb12b perf]$ > > [perfbuilder@b34646cdb12b perf]$ make O=/tmp/build/kernel/ > make[1]: Entering directory '/tmp/build/kernel' > CHK include/config/kernel.release > Using /git/perf as source for kernel > GEN ./Makefile > CHK include/generated/uapi/linux/version.h > CHK include/generated/utsrelease.h > CHK include/generated/bounds.h > CHK include/generated/timeconst.h > CHK include/generated/asm-offsets.h > CALL /git/perf/scripts/checksyscalls.sh > DESCEND objtool > CC /tmp/build/kernel/tools/objtool/str_error_r.o > LD /tmp/build/kernel/tools/objtool/objtool-in.o > LINK /tmp/build/kernel/tools/objtool/objtool > CHK scripts/mod/devicetable-offsets.h > HOSTCC scripts/asn1_compiler > > > :-\ > > But I noticed some of those warnings and started action on then for > tools/perf, things like: > > "perf annotate: Use asprintf when formatting objdump command line" > > https://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git/commit/?id=f22ed8ad2ca0 > > - Arnaldo > 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 Thanks, Laura