From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964955AbcHaPC4 (ORCPT ); Wed, 31 Aug 2016 11:02:56 -0400 Received: from us-smtp-delivery-194.mimecast.com ([216.205.24.194]:40123 "EHLO us-smtp-delivery-194.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934973AbcHaPCx (ORCPT ); Wed, 31 Aug 2016 11:02:53 -0400 From: Trond Myklebust To: Arnd Bergmann CC: Schumaker Anna , "List Linux Network Devel Mailing" , List Linux NFS Mailing , List Linux Kernel Mailing Subject: Re: [PATCH 1/2] NFSv4.1: work around -Wmaybe-uninitialized warning Thread-Topic: [PATCH 1/2] NFSv4.1: work around -Wmaybe-uninitialized warning Thread-Index: AQHSA4StdwGC8028SUiPzNzQJCnXO6BjDRqAgAAFfgCAABfQAA== Date: Wed, 31 Aug 2016 15:02:42 +0000 Message-ID: References: <20160831123911.3467676-1-arnd@arndb.de> <9F99A562-A4F6-457A-A78F-44BAC3B5734F@primarydata.com> <5024842.0SZmq2hZxe@wuerfel> In-Reply-To: <5024842.0SZmq2hZxe@wuerfel> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [68.49.162.121] x-ms-office365-filtering-correlation-id: 29bf6ada-7967-4b85-c0aa-08d3d1afdbb0 x-microsoft-exchange-diagnostics: 1;DM5PR11MB1899;20:5i2kNB5M94BNpHy73qu6OSuSzPDsEzVxexodxzdYurtbb56qISpoynASsY90XhN4Pltc+eSR5O6QCnE7SRPvPDNBI6c0gvBVTiRm8q5ciLjtlqCmvIcozBmpSQ5HCGRMKz2vtPNYMM1gWFYCCZl+KrNLVS/AspwGRyiCUXKP6l8= x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:DM5PR11MB1899; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(6040176)(601004)(2401047)(5005006)(8121501046)(10201501046)(3002001)(6042046)(6043046);SRVR:DM5PR11MB1899;BCL:0;PCL:0;RULEID:;SRVR:DM5PR11MB1899; x-forefront-prvs: 00514A2FE6 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(6009001)(7916002)(199003)(189002)(377454003)(24454002)(76176999)(586003)(3660700001)(5002640100001)(102836003)(189998001)(83716003)(50986999)(92566002)(68736007)(110136002)(3280700002)(2906002)(81166006)(81156014)(8936002)(33656002)(82746002)(4326007)(5660300001)(19580405001)(19580395003)(8676002)(7846002)(106116001)(66066001)(77096005)(54356999)(6116002)(87936001)(10400500002)(11100500001)(305945005)(97736004)(106356001)(101416001)(36756003)(3846002)(105586002)(99286002)(86362001)(2900100001)(2950100001)(7736002)(122556002)(104396002);DIR:OUT;SFP:1102;SCL:1;SRVR:DM5PR11MB1899;H:DM5PR11MB1899.namprd11.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-ID: <44CB5F5F4C784A4E880F8B2AD6A793FA@namprd11.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: primarydata.com X-MS-Exchange-CrossTenant-originalarrivaltime: 31 Aug 2016 15:02:42.1295 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 03193ed6-8726-4bb3-a832-18ab0d28adb7 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR11MB1899 X-MC-Unique: PM4KPLlGNomMBkE2hTT4Rw-1 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by mail.home.local id u7VF338K005537 > On Aug 31, 2016, at 09:37, Arnd Bergmann wrote: > > On Wednesday, August 31, 2016 1:17:48 PM CEST Trond Myklebust wrote: >> What version of gcc are you using? I’m unable to reproduce with gcc 6.1.1.. > > This is also on 6.1.1 for ARM. Note that 6e8d666e9253 ("Disable > "maybe-uninitialized" warning globally") turned off those warnings, so > unless you explicitly pass -Wmaybe-uninitialized (e.g. by building with > "make W=1"), you won't get it. > I’m not getting that error on gcc 6.1.1 for x86_64 with either “make W=1” or “make W=2”. “make W=3” does gives rise to one warning in nfs4_slot_get_seqid: /home/trondmy/devel/kernel/linux/fs/nfs/nfs4session.c: In function ‘nfs4_slot_get_seqid’: /home/trondmy/devel/kernel/linux/fs/nfs/nfs4session.c:184:10: warning: conversion to ‘int’ from ‘long int’ may alter its value [-Wconversion] return PTR_ERR(slot); ^~~~~~~~~~~~~ (which is another false positive) but that’s all... > The reason I'm still sending the patches for this warning is that > we do get a number of valid ones (this was the only false positive > out of the seven such warnings since last week). There is a Zen-like quality to IS_ERR() when it casts a const pointer to an unsigned long, back to a non-const pointer, and then back to an unsigned long before comparing it to another unsigned long cast constant negative integer. However, I’m not sure the C99 standard would agree that a positive test result implies we can assume that a simple cast of the same pointer to a signed long will result in a negative, non-zero valued errno. I suspect that if we really want to fix these false negatives, we should probably address that issue. Cheers Trond