From owner-freebsd-current@freebsd.org Mon Jun 4 11:48:18 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 CA2F3FD06C9 for ; Mon, 4 Jun 2018 11:48:17 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) Received: from CAN01-TO1-obe.outbound.protection.outlook.com (mail-eopbgr670068.outbound.protection.outlook.com [40.107.67.68]) (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 5AFAB8251A for ; Mon, 4 Jun 2018 11:48:17 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) Received: from YTOPR0101MB0953.CANPRD01.PROD.OUTLOOK.COM (52.132.44.24) by YTOPR0101MB0841.CANPRD01.PROD.OUTLOOK.COM (52.132.48.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.820.11; Mon, 4 Jun 2018 11:48:15 +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; Mon, 4 Jun 2018 11:48:15 +0000 From: Rick Macklem To: Matthew Macy , Theron CC: "freebsd-current@freebsd.org" Subject: Re: 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+kHu8bdJXk68BDSBUTlIlaRPDeQAgAACBICAAAD8gIAA6p4/ Date: Mon, 4 Jun 2018 11:48:15 +0000 Message-ID: References: , In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=rmacklem@uoguelph.ca; x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; YTOPR0101MB0841; 7:+yAWtvafW+s62xYBTbBdJqrbC19Peve4sRbcXFe+BEuxRScDV1J2EHDgdqLs1hE5e7sK8NwfBCrDpOQdj6S5Cm+x7AxlKROv/qIRuoA9Mm5ygOz964XVkLqd5kcRdkqmRmTqolBSqUKH622ek+Ft8lSb48c7m4fYZyblRe4KSyztfagcJvLr5/C0EsU3lZ92Z4JE1/q7/+Nq3EDPmX/AJ5XkDVYOc8/jUP7I5Rn0bBqQ+bizoWt7tHAL7GQEsy6i 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:YTOPR0101MB0841; x-ms-traffictypediagnostic: YTOPR0101MB0841: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(22074186197030)(85827821059158)(183786458502308)(75325880899374); x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(6040522)(2401047)(8121501046)(5005006)(3002001)(3231254)(944501410)(52105095)(93006095)(93001095)(10201501046)(149027)(150027)(6041310)(201703131423095)(201702281529075)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123562045)(20161123564045)(20161123560045)(6072148)(201708071742011)(7699016); SRVR:YTOPR0101MB0841; BCL:0; PCL:0; RULEID:; SRVR:YTOPR0101MB0841; x-forefront-prvs: 069373DFB6 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(39860400002)(39380400002)(376002)(346002)(366004)(396003)(199004)(189003)(6506007)(186003)(102836004)(97736004)(11346002)(966005)(316002)(786003)(446003)(26005)(110136005)(2906002)(478600001)(55016002)(4326008)(33656002)(229853002)(68736007)(3280700002)(3660700001)(8936002)(19625735003)(476003)(6306002)(7696005)(8676002)(76176011)(74482002)(105586002)(99286004)(6436002)(106356001)(93886005)(74316002)(25786009)(2900100001)(14454004)(81156014)(81166006)(53936002)(86362001)(5250100002)(59450400001)(9686003)(486006)(6246003)(39060400002)(5660300001)(305945005); DIR:OUT; SFP:1101; SCL:1; SRVR:YTOPR0101MB0841; H:YTOPR0101MB0953.CANPRD01.PROD.OUTLOOK.COM; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: uoguelph.ca does not designate permitted sender hosts) x-microsoft-antispam-message-info: 68EJ12KHdqPPM0W2C0erkIm3DpC1fiAbI6gd+VgYjQWRB6dGP3UAiVuZDImR8f/OZR92D0/yfqygTQI5SHxfxgEOUHiIEK4/jD2C+4/qtpirHvLha5gltaXp3rvd425XrOMUyFUINRcJrMCStgiGUqZOPJfmDt7sw5CkDV+w8XcsQV5LyFoy+PikF47bKBXM 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: 9d0f86db-5d12-4b42-e1c9-08d5ca110f0b X-OriginatorOrg: uoguelph.ca X-MS-Exchange-CrossTenant-Network-Message-Id: 9d0f86db-5d12-4b42-e1c9-08d5ca110f0b X-MS-Exchange-CrossTenant-originalarrivaltime: 04 Jun 2018 11:48:15.8172 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: be62a12b-2cad-49a1-a5fa-85f4f3156a7d X-MS-Exchange-Transport-CrossTenantHeadersStamped: YTOPR0101MB0841 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: Mon, 04 Jun 2018 11:48:18 -0000 Matthew Macy wrote: >On Sun, Jun 3, 2018 at 2:40 PM, Theron wrote: >>> 4. Disable the stupid warning in the Makefile / build system. If you do= n't >>> care, and there's a good reason for what you are doing (sounds like the= re >>> is), better to just disable the warning as so much useless noise. >>> >>> Warner >>> _______________________________________________ >>> freebsd-current@freebsd.org mailing list >>> https://lists.freebsd.org/mailman/listinfo/freebsd-current >>> To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.o= rg" >> >> Or possibly, alongside a comment as in (3), use one of these: >> 5 - Disable warning pragma - >> http://gcc.gnu.org/onlinedocs/gcc/Diagnostic-Pragmas.html >> 6 - Use __attribute__((unused)) - > https://gcc.gnu.org/onlinedocs/gcc/Common-Variable-Attributes.html#Common= -Variable-Attributes > > >There is already an __unused alias for #6. It's what I've used to >annotate variables that are only used by INVARIANTS builds. It >legitimately finds a bunch of dead code. However, 90+% of the >instances of the warning are not interesting. Ok. I didn't realize that __unused would work for this case of "set but not= used" but I just tried it on the older gcc48 I have lying around and it worked. (clang doesn't seem to warn or care about these cases.) I may use this, since I avoid messing with the make files like the plague. Thanks, rick