lkml.org 
[lkml]   [2014]   [Jul]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] fs/direct-io.c: Fix compilation warning for uninitialized variables
From
Date
[Added Borislav and Sam to cc.]

Christoph Hellwig schreef op wo 16-07-2014 om 10:58 [-0700]:
> On Wed, Jul 16, 2014 at 08:08:41PM +0300, Boaz Harrosh wrote:
> > This is the wrong fix. GCC is wrong here. As shown by Paul Bolle if
> > you move the from / to set from dio_get_page() to here the warning goes away.
> >
> > The minimal fix must use uninitialized_var() in this case. See patch below
> >
> > But I think the proper fix Is the one Paul Bolle <pebolle@tiscali.nl> sent (above)
>
> I don't think the initialization is wrong. The fix of moving the code
> defintively looks nicer,

Whether that was Jason's idea or mine doesn't matter much - though I do
think Boaz quoted part of my fix, but it was just a _draft_.

Anyhow, after all that I got involved in a short thread;
https://lkml.org/lkml/2014/7/8/168 is my contribution. My point is,
basically, that the false positives of -Wmaybe-uninitialized are a "code
smell". They tend to disappear if one reorganizes the code a bit.
Borislav disagrees quite strongly. I didn't really bother with keeping
that thread alive because I feared we'd mainly see more colorful
language.

> while I think uninitialized_var is horrible wart

Agree totally.

> that won't get anywhere near my code.
>
> Either way we should merge one of those fixes ASAP..

I'd like my builds to be warning free too. And it would be nice to know
whether there's consensus on how to deal with the false positives of
-Wmaybe-uninitialized that make it into mainline.


Paul Bolle



\
 
 \ /
  Last update: 2014-07-16 21:21    [W:0.090 / U:0.400 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site