-
-
Notifications
You must be signed in to change notification settings - Fork 7.1k
tests: Fix ignored attributes warning during build #4670
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
Conversation
Signed-off-by: Gianfranco Costamagna <locutusofborg@debian.org>
3a8d427
to
7206a82
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I fail to understand the reason for the change. decltype(&std::fclose)
is supposed to be int (*)(FILE *)
, so why do you need to make this explicit and add a type alias?
Thanks! So to silence GCC's warning about an ignored attribute, we define a unique pointer deleter type without that attribute and call this a fix, because GCC does not realize that we then instantiate this deleter with a function whose argument has an attribute? |
The warning is only on the template declaration, so moving it to the instantiation doesn't trigger that particular warning. They may expand it or add a new one in the future. As described in the thread, below would be a better solution for size and performance if it were in the main library, but since it's in the tests, we're not as concerned about size and performance.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me.
Thanks for the clarification! I will merge this once #4701 is merged, because otherwise the CI would fail. |
thanks! |
Thank you! |
Fix build warning.