Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #12989: Honor attribute cleanup in unusedFunction #6656

Merged
merged 2 commits into from
Aug 6, 2024

Conversation

mptre
Copy link
Contributor

@mptre mptre commented Aug 3, 2024

Gets rid of FPs when a static function is only used with attribute cleanup.

@chrchr-github chrchr-github changed the title Honor attribute cleanup in unusedFunction Fix #12989: Honor attribute cleanup in unusedFunction Aug 6, 2024
{
check("void clean(void *ptr) {}\n"
"void * __attribute__((cleanup(clean))) p;\n");
ASSERT_EQUALS("", errout_str());
Copy link
Collaborator

Choose a reason for hiding this comment

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

The example compiles but results in

<source>:2:27: warning: 'cleanup' attribute only applies to local variables [-Wignored-attributes]
    2 |     void * __attribute__((cleanup(clean))) p;

But it probably doesn't matter for the test.

Gets rid of FPs when a static function is only used with the attribute cleanup.
@mptre
Copy link
Contributor Author

mptre commented Aug 6, 2024 via email

@chrchr-github chrchr-github merged commit 7ece4f6 into danmar:main Aug 6, 2024
63 checks passed
@mptre mptre deleted the attribute-cleanup branch November 14, 2024 07:44
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