Skip to content

gtk.cfg: Remove transfer none function g_application_get_default#8545

Open
Tamaranch wants to merge 1 commit into
cppcheck-opensource:mainfrom
Tamaranch:g_application_get_default
Open

gtk.cfg: Remove transfer none function g_application_get_default#8545
Tamaranch wants to merge 1 commit into
cppcheck-opensource:mainfrom
Tamaranch:g_application_get_default

Conversation

@Tamaranch
Copy link
Copy Markdown

@chrchr-github
Copy link
Copy Markdown
Collaborator

Thanks for your contribution, please add a test to test/cfg/gtk.c.

@Tamaranch Tamaranch force-pushed the g_application_get_default branch from a827403 to fd1c867 Compare May 11, 2026 10:22
@Tamaranch
Copy link
Copy Markdown
Author

Thanks for your contribution, please add a test to test/cfg/gtk.c.

Done. Note that I need to add --check-level=exhaustive and remove an inline suppression to run the tests with exitcode=0:

Checking test/cfg/gtk.c ...
test/cfg/gtk.c:0:0: information: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. [normalCheckLevelMaxBranches]

^
test/cfg/gtk.c:83:0: information: Unmatched suppression: valueFlowBailout [unmatchedSuppression]
        printf("%s", str);
^
nofile:0:0: information: Active checkers: 118/186 (use --checkers-report=<filename> to see details) [checkersReport]

Comment thread cfg/gtk.cfg
<use>g_file_attribute_matcher_ref</use>
<dealloc>g_file_attribute_matcher_unref</dealloc>
</memory>
<function name="g_application_get_default">
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this have use-retval?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I think so, in the sense that it's pointless to call this function and ignore the return value (so it's not as serious as ignoring the return value of g_list_prepend, for example). I’ve added it, along with the return type.

@Tamaranch Tamaranch force-pushed the g_application_get_default branch from fd1c867 to 6e337ff Compare May 11, 2026 17:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants