Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Overview: initialize color variables #916
While this might not be necessary technically, cppcheck complained:
While this might not be necessary technically, cppcheck complained: overviewscintilla.c:800:53: note: Calling function 'overview_scintilla_get_overlay_color', 2nd argument '&color' value is <Uninit> overview_scintilla_get_overlay_color (self, &color); ^ overviewscintilla.c:1146:11: note: Uninitialized variable: color
I haven't done a proper survey, but I'd wager if we did, we'd find hundreds if not thousands of uninitialized variables in Geany and GP's code.
If it did proper analysis (ie. look into callee) it would see it's passed to
In any case, I'm fine with this PR if it shuts up
@elextr got a point, it's actually technically correct to say the value may not be initialized because of those checks, and it seem impossible for a tool to infer that those checks will succeed, even if we know they will -- unless something else went terribly bad and we're fubar.
So although I initially blamed that on cppcheck, I guess it's fair and this PR makes sense.