lkml.org 
[lkml]   [2005]   [Oct]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: 2.6.14 assorted warnings
Date
On Freedag 28 Oktober 2005 09:30, Dave Jones wrote:
> gcc is dumb, it doesn't realise that the variable will be filled by another
> function if its passed thus..
>
>         unsigned long foo
>         bar(&foo)
>         if (foo==1)
>                 ...
>
> With bar() filling in content of foo.
> I believe there's at least once instance of this in gcc bugzilla.
>
The case is more complicated here. gcc before 4.0 always assumed that
bar(&foo); initializes foo. gcc-4.0 now looks into bar if it is inlining
that and tries to find out if that really initializes foo in every
case.

In the example, bvec_alloc_bs does not initialize &idx when nr is not
between 1 and BIO_MAX_PAGES, so gcc is telling the truth here.

Arnd <><
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-10-28 10:08    [W:0.245 / U:0.160 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site