[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20170622075104.dlajhtcx7p3sgacs@gmail.com>
Date: Thu, 22 Jun 2017 09:51:04 +0200
From: Ingo Molnar <mingo@...nel.org>
To: Arnd Bergmann <arnd@...db.de>
Cc: "Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>,
Thomas Gleixner <tglx@...utronix.de>,
Sebastian Andrzej Siewior <bigeasy@...utronix.de>,
Anna-Maria Gleixner <anna-maria@...utronix.de>,
Boris Ostrovsky <boris.ostrovsky@...cle.com>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] rcu: remove unused variable in boot_cpu_state_init
* Arnd Bergmann <arnd@...db.de> wrote:
> > So I think we should consider it a syntactic construct to avoid.
>
> Unused variables are relatively harmless compared to used-uninitialized
> variables that are always bugs (though they are provably impossible to
> detect correctly in some cases).
So the thing I was most worried about was that old GCC used to not warn about:
long __maybe_unused error;
...
if (error)
return error;
... but recent GCC does warn if it's certain that the use is uninitialized, so the
scenario I outlined should not happen.
But it will supress the warning if the variable is uninitialized but GCC cannot
prove it for sure, so my point remains that it's a potentially dangerous
construct.
Thanks,
Ingo
Powered by blists - more mailing lists