From owner-svn-src-head@freebsd.org Thu May 24 06:34:53 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0BDECF5903E; Thu, 24 May 2018 06:34:53 +0000 (UTC) (envelope-from Michael.Tuexen@macmic.franken.de) Received: from drew.franken.de (drew.ipv6.franken.de [IPv6:2001:638:a02:a001:20e:cff:fe4a:feaa]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.franken.de", Issuer "COMODO RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8DFD8788A1; Thu, 24 May 2018 06:34:52 +0000 (UTC) (envelope-from Michael.Tuexen@macmic.franken.de) Received: from [IPv6:2a02:c6a0:3061:5015:d5fd:469e:8c1d:2921] (unknown [IPv6:2a02:c6a0:3061:5015:d5fd:469e:8c1d:2921]) (Authenticated sender: macmic) by drew.franken.de (Postfix) with ESMTPSA id 75346721E280C; Thu, 24 May 2018 08:34:48 +0200 (CEST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 11.3 \(3445.6.18\)) Subject: Re: svn commit: r333860 - head/sys/kern From: Michael Tuexen In-Reply-To: Date: Thu, 24 May 2018 08:35:30 +0200 Cc: Gleb Smirnoff , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <5B9EE208-384F-44AD-9B47-059D77FE9B34@macmic.franken.de> References: <201805190510.w4J5AqfS054367@repo.freebsd.org> <20180523222743.GU71675@FreeBSD.org> <20180523225729.GV71675@FreeBSD.org> <20180524044252.GW71675@FreeBSD.org> To: Matthew Macy X-Mailer: Apple Mail (2.3445.6.18) X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=disabled version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on mail-n.franken.de X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 May 2018 06:34:53 -0000 > On 24. May 2018, at 06:51, Matthew Macy wrote: >=20 > Warnings find bugs PERIOD. Although most are not useful, I've found Some warnings indicate bugs, some warnings are just wrong. If you have a "may be used uninitialized" warning being a false positive, you may silences the warning by just set it to zero in the declaration and you silence it. Other compilers might then correctly report an assignment without affect... Best regards Michael > quite a number of real issues from compiling with gcc8. >=20 > If you want to _actually_ be helpful fix these: > https://people.freebsd.org/~mmacy/gcc8logs/GENERIC-NODEBUG.log >=20 > https://people.freebsd.org/~mmacy/gcc8logs/GENERIC.log >=20 > On Wed, May 23, 2018 at 9:42 PM, Gleb Smirnoff = wrote: >> Let me repeat again. The warning is a false positive, and thus = assignment >> isn't useful. I'm not worried about a single instruction, more about >> polluting the code. >>=20 >> If the warning was escalated to build error, and we did carry about >> building with gcc8, in this case the assignment should be added with >> a comment /* pacify gcc */. >>=20 >> On Wed, May 23, 2018 at 03:59:33PM -0700, Matthew Macy wrote: >> M> On Wed, May 23, 2018 at 3:57 PM, Gleb Smirnoff = wrote: >> M> > The initialization isn't useful. >> M> >> M> It silences a gcc warning. So yes it is. It's this exchange which = is not useful. >> M> >> M> -M >> M> >> M> >> M> > On Wed, May 23, 2018 at 03:52:42PM -0700, Matthew Macy wrote: >> M> > M> Talk to the gcc devs. The warning is useful even if there are = false positives. >> M> > M> >> M> > M> On Wed, May 23, 2018 at 3:27 PM, Gleb Smirnoff = wrote: >> M> > M> > Hi, >> M> > M> > >> M> > M> > On Sat, May 19, 2018 at 05:10:52AM +0000, Matt Macy wrote: >> M> > M> > M> Author: mmacy >> M> > M> > M> Date: Sat May 19 05:10:51 2018 >> M> > M> > M> New Revision: 333860 >> M> > M> > M> URL: https://svnweb.freebsd.org/changeset/base/333860 >> M> > M> > M> >> M> > M> > M> Log: >> M> > M> > M> sendfile: annotate unused value and ensure that npages = is actually initialized >> M> > M> > M> >> M> > M> > M> Modified: >> M> > M> > M> head/sys/kern/kern_sendfile.c >> M> > M> > M> >> M> > M> > M> Modified: head/sys/kern/kern_sendfile.c >> M> > M> > M> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >> M> > M> > M> --- head/sys/kern/kern_sendfile.c Sat May 19 05:09:10 = 2018 (r333859) >> M> > M> > M> +++ head/sys/kern/kern_sendfile.c Sat May 19 05:10:51 = 2018 (r333860) >> M> > M> > M> @@ -341,7 +341,7 @@ sendfile_swapin(vm_object_t obj, = struct sf_io *sfio, o >> M> > M> > M> } >> M> > M> > M> >> M> > M> > M> for (int i =3D 0; i < npages;) { >> M> > M> > M> - int j, a, count, rv; >> M> > M> > M> + int j, a, count, rv __unused; >> M> > M> > M> >> M> > M> > M> /* Skip valid pages. */ >> M> > M> > M> if (vm_page_is_valid(pa[i], vmoff(i, off) & = PAGE_MASK, >> M> > M> > M> @@ -688,6 +688,7 @@ retry_space: >> M> > M> > M> if (space =3D=3D 0) { >> M> > M> > M> sfio =3D NULL; >> M> > M> > M> nios =3D 0; >> M> > M> > M> + npages =3D 0; >> M> > M> > M> goto prepend_header; >> M> > M> > M> } >> M> > M> > M> hdr_uio =3D NULL; >> M> > M> > >> M> > M> > This initialization is redundant and a compiler warning if = exists is wrong. >> M> > M> > >> M> > M> > If we jump down to prepend_header with nios =3D=3D 0, we = won't ever use npages. >> M> > M> > >> M> > M> > -- >> M> > M> > Gleb Smirnoff >> M> > >> M> > -- >> M> > Gleb Smirnoff >>=20 >> -- >> Gleb Smirnoff >=20