Re: [PATCH] rcu: remove unused variable in boot_cpu_state_init
From: Ingo Molnar
Date: Thu Jun 22 2017 - 03:54:19 EST
* Ingo Molnar <mingo@xxxxxxxxxx> wrote:
>
> * Arnd Bergmann <arnd@xxxxxxxx> 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;
Gah - I got totally confused, the dangerous construct I was thinking of was
uninitialized_var(), not __maybe_unused.
So ignore my replies! :-)
Thanks,
Ingo