From owner-freebsd-current@freebsd.org Sun Jun 3 22:06:32 2018 Return-Path: Delivered-To: freebsd-current@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 E2941FE3201 for ; Sun, 3 Jun 2018 22:06:31 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-no.shaw.ca (smtp-out-no.shaw.ca [64.59.134.9]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 705027FF1D for ; Sun, 3 Jun 2018 22:06:31 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.125.17]) by shaw.ca with ESMTPA id Pb8mfMCCivB5RPb8nfWhGa; Sun, 03 Jun 2018 16:06:23 -0600 X-Authority-Analysis: v=2.3 cv=PvS9kTE3 c=1 sm=1 tr=0 a=VFtTW3WuZNDh6VkGe7fA3g==:117 a=VFtTW3WuZNDh6VkGe7fA3g==:17 a=kj9zAlcOel0A:10 a=7mUfYlMuFuIA:10 a=xfDLHkLGAAAA:8 a=hF2rLc1pAAAA:8 a=YxBL1-UpAAAA:8 a=6I5d2MoRAAAA:8 a=f4XEX6ON5feEunTDJdkA:9 a=CjuIK1q_8ugA:10 a=iB5APFlFwgEA:10 a=IfaqVvZgccqrtc8gcwf2:22 a=O9OM7dhJW_8Hj9EqqvKN:22 a=Ia-lj3WSrqcvXOmTRaiG:22 a=IjZwj45LgO3ly-622nXo:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTPS id 17CB32C6A; Sun, 3 Jun 2018 15:06:20 -0700 (PDT) Received: from slippy.cwsent.com (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id w53M6JSZ095955; Sun, 3 Jun 2018 15:06:19 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Received: from slippy (cy@localhost) by slippy.cwsent.com (8.15.2/8.15.2/Submit) with ESMTP id w53M6Jkp095952; Sun, 3 Jun 2018 15:06:19 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201806032206.w53M6Jkp095952@slippy.cwsent.com> X-Authentication-Warning: slippy.cwsent.com: cy owned process doing -bs X-Mailer: exmh version 2.8.0 04/21/2012 with nmh-1.7.1 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Warner Losh cc: Rick Macklem , "freebsd-current@freebsd.org" Subject: Re: how to deal with variable set but not used warnings? In-Reply-To: Message from Warner Losh of "Sun, 03 Jun 2018 15:33:02 -0600." Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Sun, 03 Jun 2018 15:06:19 -0700 X-CMAE-Envelope: MS4wfPy6ZbTKRg2azon6lyqLjj07Yp+Qk2xJZu00udsxOL2vVyp4E9xtQG2zHo9aHBxcy+dIWmqbjkkEV1ssFYTumjZbFATkS4Bc73H5zd3Z/WG9oP2lMz/9 0iMyIBhjUXgyZLzDenR4d8nrkBRq+VPp5juXM9SnB2BLrtD1K6SXZreY9xAQQOyW5S3MDhq2mf9Cy7lK82eWuawuYXNHphajmrx2AIE32YwQuW3kT0FBekp+ I4O+gfQGiTtHLUiLy2NeYQ== X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jun 2018 22:06:32 -0000 In message , Warner Losh writes: > On Sun, Jun 3, 2018 at 3:28 PM, Rick Macklem wrote: > > > mmacy has sent me a bunch of warnings of the "variable set but not used" > > kind > > generated by gcc8. > > > > When I've looked at the code, these are for RPC arguments I parse but do > > not > > use at this time. > > I'd like to leave the code in place, since these arguments may be needed > > in the > > future and it is hard to figure out how to get them years from now, when > > they > > might be needed. > > I can think of 3 ways to handle this: > > 1 - Get rid of the code. (As above, I'd rather not do this.) > > 2 - Wrap the code with "#if 0"/"#endif" or similar. I'll admit that I find > > this rather > > ugly and tends to make the code harder to follow. > > 3 - Leave the code and add a comment w.r.t. why the variables are set but > > not used. > > > > So, what do others think is the preferable alternative? > > (Or maybe you have a #4 that seems better than any of these.) > > > > 4. Disable the stupid warning in the Makefile / build system. If you don't > care, and there's a good reason for what you are doing (sounds like there > is), better to just disable the warning as so much useless noise. And leave a comment in the Makefile in case someone decides to re-enable the warning at some later date. -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few.