uts: boot_fb_eraseline_impl() may use uninitialized variable
The gcc did complain:
../../i86pc/boot/boot_fb.c:503:9: error: 'sdst' may be used uninitialized in this function [-Werror=maybe-uninitialized]
The warning by itself appears false positive, however, we can avoid such case just by setting sdst unconditionally.
Updated by Dan McDonald over 2 years ago
This is an interesting case of gcc evaluating inside a loop, but being unaware of what was done outside its context, but safely in-function.
sdst being set unconditionally at first seems reckless, but since sdst is only used inside the for loop if fb_info.shadow_fb is non-NULL, it's sensible.
Updated by Electric Monk over 2 years ago
- Status changed from In Progress to Closed
- % Done changed from 90 to 100
commit a6f5e66afa6ed3ba58a8adebd9096d051e369784 Author: Toomas Soome <email@example.com> Date: 2019-02-04T18:39:12.000Z 10341 uts: boot_fb_eraseline_impl() may use uninitialized variable Reviewed by: Andy Stormont <firstname.lastname@example.org> Reviewed by: Gergő Doma <email@example.com> Approved by: Dan McDonald <firstname.lastname@example.org>