From owner-freebsd-current@freebsd.org Sun Jun 3 21:28:49 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 65C4AFDE628 for ; Sun, 3 Jun 2018 21:28:49 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) Received: from CAN01-TO1-obe.outbound.protection.outlook.com (mail-eopbgr670084.outbound.protection.outlook.com [40.107.67.84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (Client CN "mail.protection.outlook.com", Issuer "Microsoft IT TLS CA 4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 006C87DFFB for ; Sun, 3 Jun 2018 21:28:48 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) Received: from YTOPR0101MB0953.CANPRD01.PROD.OUTLOOK.COM (52.132.44.24) by YTOPR0101MB1900.CANPRD01.PROD.OUTLOOK.COM (52.132.49.140) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.820.12; Sun, 3 Jun 2018 21:28:47 +0000 Received: from YTOPR0101MB0953.CANPRD01.PROD.OUTLOOK.COM ([fe80::a860:9237:2e9f:f87f]) by YTOPR0101MB0953.CANPRD01.PROD.OUTLOOK.COM ([fe80::a860:9237:2e9f:f87f%3]) with mapi id 15.20.0820.015; Sun, 3 Jun 2018 21:28:47 +0000 From: Rick Macklem To: "freebsd-current@freebsd.org" Subject: how to deal with variable set but not used warnings? Thread-Topic: how to deal with variable set but not used warnings? Thread-Index: AQHT+4Ei+kHu8bdJXk68BDSBUTlIlQ== Date: Sun, 3 Jun 2018 21:28:47 +0000 Message-ID: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; YTOPR0101MB1900; 7:98srb8/R8EWIHX+LiyxUj2pYfEoCga0JPBXnIxCdLGrwx9SShU2FrW1xUlIsXxRd3JETB5lFe87vDjSv644569uGLEMT0zfClaU4FQNgli3rzcJ3oberbceKRwH67Vnd26I/sb8F7QxFtZBDxdEP8QoqT49Ss0eJFasTrhKFDN3zpHTeRY94/wofhsQH4bOu4Dqkoa99adwBoE8kTc1kEhRTgkAAihQ2jyy28LWk6pvNSyT4ZXGFXeO0wpLOPcGw x-ms-exchange-antispam-srfa-diagnostics: SOS; x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(8989080)(5600026)(4534165)(4627221)(201703031133081)(201702281549075)(8990040)(2017052603328)(7153060)(7193020); SRVR:YTOPR0101MB1900; x-ms-traffictypediagnostic: YTOPR0101MB1900: authentication-results: spf=none (sender IP is ) smtp.mailfrom=rmacklem@uoguelph.ca; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(6040522)(2401047)(8121501046)(5005006)(10201501046)(3002001)(93006095)(93001095)(3231254)(944501410)(52105095)(149027)(150027)(6041310)(20161123558120)(201703131423095)(201702281529075)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123560045)(20161123564045)(6072148)(201708071742011)(7699016); SRVR:YTOPR0101MB1900; BCL:0; PCL:0; RULEID:; SRVR:YTOPR0101MB1900; x-forefront-prvs: 069255B8B8 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(346002)(396003)(376002)(366004)(39380400002)(39860400002)(189003)(199004)(99286004)(68736007)(305945005)(102836004)(81156014)(81166006)(26005)(2351001)(105586002)(86362001)(106356001)(74316002)(478600001)(33656002)(316002)(25786009)(786003)(3660700001)(74482002)(3280700002)(14454004)(97736004)(5660300001)(2501003)(476003)(8676002)(5640700003)(9686003)(55016002)(8936002)(6916009)(186003)(53936002)(6506007)(6436002)(2906002)(2900100001)(7696005)(486006)(5250100002); DIR:OUT; SFP:1101; SCL:1; SRVR:YTOPR0101MB1900; H:YTOPR0101MB0953.CANPRD01.PROD.OUTLOOK.COM; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: uoguelph.ca does not designate permitted sender hosts) x-microsoft-antispam-message-info: E+gGKbrVkpI+6lXIqGwL5O9sm+3faTv4f03BDhN4e630zmSN7BiokXqsvvt0uCweURn9jD67BOIT4/eEpGMyjmha9aYN/UpjiYYjLr+aNP9ZyDWU4LzaXzt44ytIBqeVUnJWYaTzXgopuhUh6Am5/7OQdDbNxjv1l/hklMzQOYyXs2fLFPoYEB/nDSMR0nzq spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: 16243b8e-55ff-4718-1469-08d5c998fdcb X-OriginatorOrg: uoguelph.ca X-MS-Exchange-CrossTenant-Network-Message-Id: 16243b8e-55ff-4718-1469-08d5c998fdcb X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Jun 2018 21:28:47.2324 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: be62a12b-2cad-49a1-a5fa-85f4f3156a7d X-MS-Exchange-Transport-CrossTenantHeadersStamped: YTOPR0101MB1900 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 21:28:49 -0000 mmacy has sent me a bunch of warnings of the "variable set but not used" ki= nd generated by gcc8. When I've looked at the code, these are for RPC arguments I parse but do no= t use at this time. I'd like to leave the code in place, since these arguments may be needed i= n the future and it is hard to figure out how to get them years from now, when th= ey 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 n= ot used. So, what do others think is the preferable alternative? (Or maybe you have a #4 that seems better than any of these.) Thanks for your comments, rick=