On Thu, Apr 25, 2019 at 08:47:41AM +0200, Greg Kroah-Hartman wrote:
On Thu, Apr 25, 2019 at 12:34:19AM +0000, Alakesh Haloi wrote:
On Thu, Apr 18, 2019 at 03:34:59PM -0700, Andrew Morton wrote:
On Thu, 18 Apr 2019 01:20:12 +0000 Alakesh Haloi alakesh.haloi@gmail.com wrote:
This patch fixes the following uninitialized variable warning
fs/proc/task_mmu.c: In function 'show_smap.isra.33': fs/proc/task_mmu.c:761:7: warning: 'last_vma' may be used uninitialized in this function [-Wmaybe-uninitialized] bool last_vma; ^~~~~~~~
I can't immediately find a kernel tree to which this is applicable. What kernel are you patching?
This is for 4.14 stable tree. Corresponding commit does not exist in mainline as the code has changed.
I suggest updating your compiler to a sane one, I do not see this warning at all in the 4.14.y tree.
I've reproduced this warning using gcc 7.3, it looks like gcc 8.2 is smart enough to understand that this is not actually an issue.
It was "fixed" upstream with 258f669e7e88 ("mm: /proc/pid/smaps_rollup: convert to single value seq_file") which rewrote most of the code in that area.
Given that this is a harmless warning that isn't seen with newer compilers, I don't think it makes sense to do anything about it. I figured I'd send this mail out just to have a record of this issue in case it comes up again in the future.
-- Thanks, Sasha