mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Trond Myklebust <trondmy@primarydata.com>
To: Arnd Bergmann <arnd@arndb.de>
Cc: Schumaker Anna <anna.schumaker@netapp.com>,
	"List Linux Network Devel Mailing" <netdev@vger.kernel.org>,
	List Linux NFS Mailing <linux-nfs@vger.kernel.org>,
	List Linux Kernel Mailing <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 1/2] NFSv4.1: work around -Wmaybe-uninitialized warning
Date: Wed, 31 Aug 2016 15:02:42 +0000	[thread overview]
Message-ID: <DC57A918-AB14-483B-87EF-A88469193855@primarydata.com> (raw)
In-Reply-To: <5024842.0SZmq2hZxe@wuerfel>


> On Aug 31, 2016, at 09:37, Arnd Bergmann <arnd@arndb.de> 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

  reply	other threads:[~2016-08-31 15:02 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-31 12:39 Arnd Bergmann
2016-08-31 12:39 ` [PATCH 2/2] rxrpc: fix undefined behavior in rxrpc_mark_call_released Arnd Bergmann
2016-08-31 13:17 ` [PATCH 1/2] NFSv4.1: work around -Wmaybe-uninitialized warning Trond Myklebust
2016-08-31 13:37   ` Arnd Bergmann
2016-08-31 15:02     ` Trond Myklebust [this message]
2016-08-31 15:52       ` Arnd Bergmann
2016-08-31 17:39 ` [PATCH 2/2] rxrpc: fix undefined behavior in rxrpc_mark_call_released David Howells
2016-08-31 19:40   ` Arnd Bergmann
2016-08-31 20:25 ` David Howells
2016-08-31 20:31   ` Arnd Bergmann
2016-08-31 20:52   ` David Miller
2016-08-31 20:26 ` David Howells
2016-08-31 20:37   ` Arnd Bergmann
2016-08-31 21:05   ` David Howells

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=DC57A918-AB14-483B-87EF-A88469193855@primarydata.com \
    --to=trondmy@primarydata.com \
    --cc=anna.schumaker@netapp.com \
    --cc=arnd@arndb.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®