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 12 months 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 12 months ago
- Status changed from In Progress to Closed
- % Done changed from 90 to 100
commit a6f5e66afa6ed3ba58a8adebd9096d051e369784 Author: Toomas Soome <firstname.lastname@example.org> Date: 2019-02-04T18:39:12.000Z 10341 uts: boot_fb_eraseline_impl() may use uninitialized variable Reviewed by: Andy Stormont <email@example.com> Reviewed by: Gergő Doma <firstname.lastname@example.org> Approved by: Dan McDonald <email@example.com>