Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1473590
| From | Trond Myklebust <trondmy@primarydata.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH 1/2] NFSv4.1: work around -Wmaybe-uninitialized warning |
| Date | 2016-08-31 17:10 +0200 |
| Message-ID | <scfjj-40K-15@gated-at.bofh.it> (permalink) |
| References | <sccYa-2pg-7@gated-at.bofh.it> <scdAR-2Rr-7@gated-at.bofh.it> <scdUe-2XV-17@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
> 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
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH 1/2] NFSv4.1: work around -Wmaybe-uninitialized warning Arnd Bergmann <arnd@arndb.de> - 2016-08-31 14:40 +0200
[PATCH 2/2] rxrpc: fix undefined behavior in rxrpc_mark_call_released Arnd Bergmann <arnd@arndb.de> - 2016-08-31 14:40 +0200
Re: [PATCH 2/2] rxrpc: fix undefined behavior in rxrpc_mark_call_released David Howells <dhowells@redhat.com> - 2016-08-31 19:40 +0200
Re: [PATCH 2/2] rxrpc: fix undefined behavior in rxrpc_mark_call_released Arnd Bergmann <arnd@arndb.de> - 2016-08-31 21:50 +0200
Re: [PATCH 2/2] rxrpc: fix undefined behavior in rxrpc_mark_call_released David Howells <dhowells@redhat.com> - 2016-08-31 22:30 +0200
Re: [PATCH 2/2] rxrpc: fix undefined behavior in rxrpc_mark_call_released Arnd Bergmann <arnd@arndb.de> - 2016-08-31 22:40 +0200
Re: [PATCH 2/2] rxrpc: fix undefined behavior in rxrpc_mark_call_released David Howells <dhowells@redhat.com> - 2016-08-31 23:10 +0200
Re: [PATCH 2/2] rxrpc: fix undefined behavior in rxrpc_mark_call_released David Howells <dhowells@redhat.com> - 2016-08-31 22:30 +0200
Re: [PATCH 2/2] rxrpc: fix undefined behavior in rxrpc_mark_call_released Arnd Bergmann <arnd@arndb.de> - 2016-08-31 22:40 +0200
Re: [PATCH 2/2] rxrpc: fix undefined behavior in rxrpc_mark_call_released David Miller <davem@davemloft.net> - 2016-08-31 23:00 +0200
Re: [PATCH 1/2] NFSv4.1: work around -Wmaybe-uninitialized warning Trond Myklebust <trondmy@primarydata.com> - 2016-08-31 15:20 +0200
Re: [PATCH 1/2] NFSv4.1: work around -Wmaybe-uninitialized warning Arnd Bergmann <arnd@arndb.de> - 2016-08-31 15:40 +0200
Re: [PATCH 1/2] NFSv4.1: work around -Wmaybe-uninitialized warning Trond Myklebust <trondmy@primarydata.com> - 2016-08-31 17:10 +0200
Re: [PATCH 1/2] NFSv4.1: work around -Wmaybe-uninitialized warning Arnd Bergmann <arnd@arndb.de> - 2016-08-31 18:00 +0200
csiph-web