From owner-svn-src-all@freebsd.org Thu May 24 04:51:36 2018 Return-Path: Delivered-To: svn-src-all@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 6C13DEFCFC7; Thu, 24 May 2018 04:51:36 +0000 (UTC) (envelope-from mmacy@freebsd.org) Received: from smtp.freebsd.org (unknown [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1550B73875; Thu, 24 May 2018 04:51:36 +0000 (UTC) (envelope-from mmacy@freebsd.org) Received: from mail-it0-f44.google.com (mail-it0-f44.google.com [209.85.214.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) (Authenticated sender: mmacy) by smtp.freebsd.org (Postfix) with ESMTPSA id D26AFDDC9; Thu, 24 May 2018 04:51:35 +0000 (UTC) (envelope-from mmacy@freebsd.org) Received: by mail-it0-f44.google.com with SMTP id e185-v6so16225334ita.0; Wed, 23 May 2018 21:51:35 -0700 (PDT) X-Gm-Message-State: ALKqPwfo+XD4VUjdmqwKpPrleLFecClyL762DK9ZOHcwX0BAX/lbiUkJ cIdB4l2ZXDFuDDx2xjw9Y87PLo7hfUk/D1lifbo= X-Google-Smtp-Source: AB8JxZqnvzUZLU/uNkrobLC3lSLEyAnJg/f4fpnwUL0Mdu7p0kely7epr6UDvA6Egf+8y2D8qD9//tzUzeARx72BxCs= X-Received: by 2002:a24:5b54:: with SMTP id g81-v6mr7646830itb.7.1527137495268; Wed, 23 May 2018 21:51:35 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a02:85ca:0:0:0:0:0 with HTTP; Wed, 23 May 2018 21:51:34 -0700 (PDT) In-Reply-To: <20180524044252.GW71675@FreeBSD.org> References: <201805190510.w4J5AqfS054367@repo.freebsd.org> <20180523222743.GU71675@FreeBSD.org> <20180523225729.GV71675@FreeBSD.org> <20180524044252.GW71675@FreeBSD.org> From: Matthew Macy Date: Wed, 23 May 2018 21:51:34 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r333860 - head/sys/kern To: Gleb Smirnoff Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 May 2018 04:51:36 -0000 Warnings find bugs PERIOD. Although most are not useful, I've found quite a number of real issues from compiling with gcc8. If you want to _actually_ be helpful fix these: https://people.freebsd.org/~mmacy/gcc8logs/GENERIC-NODEBUG.log https://people.freebsd.org/~mmacy/gcc8logs/GENERIC.log 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. > > 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 */. > > 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> ============================================================================== > 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 = 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 == 0) { > M> > M> > M> sfio = NULL; > M> > M> > M> nios = 0; > M> > M> > M> + npages = 0; > M> > M> > M> goto prepend_header; > M> > M> > M> } > M> > M> > M> hdr_uio = 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 == 0, we won't ever use npages. > M> > M> > > M> > M> > -- > M> > M> > Gleb Smirnoff > M> > > M> > -- > M> > Gleb Smirnoff > > -- > Gleb Smirnoff