Older cppcheck versions (e.g. 1.90) complain about this while newer versions (e.g. 2.10) do not.
@techee is `FALSE` a proper default here? You can view, comment on, or merge this pull request online at:
https://github.com/geany/geany-plugins/pull/1252
-- Commit Summary --
* ProjectOrganizer: Initialise "is_header" variable
-- File Changes --
M projectorganizer/src/prjorg-utils.c (2)
-- Patch Links --
https://github.com/geany/geany-plugins/pull/1252.patch https://github.com/geany/geany-plugins/pull/1252.diff
The original looks safe, `is_header` is set at https://github.com/geany/geany-plugins/blob/6e697f2582b03db6749b91da2f247c6e... except when `known_type` is set `FALSE`. Then all uses of `is_header` are guarded by `known_type` being true so its safe.
Probably olde cppcheck simply objected to all uninitialised variables, but new cppcheck is smarter and looks at actual usage.
As @elextr said, this isn't really a use of an uninitialized value. But if it silences the warning, let's merge it so cppcheck shows only real problems.
Merged #1252 into master.
Yeah, I think too it was safe before. The intention was just to silence cppcheck.
github-comments@lists.geany.org