Re: build warning question - gcc 4.4.5

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 6 Jan 2014, Nicholas Mc Guire wrote:

during Linux kernel build I got the following build warning

kernel/trace/trace.c: In function 'tracing_mark_write':
kernel/trace/trace.c:3818: warning: 'page2' may be used uninitialized in this function

after looking at this function I was not able to figure out how
this uninitialized usage could happen - all access to page2
is "protected" by an "if (nr_pages == 2)" so no uninitialized
access should be possible.

Note the word "may": gcc isn't able (at least at this optimization level) to prove that page2 is always initialized before use, so it warns.

is there some way to make gcc happy here ?

Initialize page2 to 0 where you declare it?

--
Marc Glisse




[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux