-
Notifications
You must be signed in to change notification settings - Fork 73
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
wrap cfile
's fclose()
to avoid warning on latest glibc
#1592
Conversation
@@ -19,7 +19,11 @@ | |||
namespace fc { | |||
|
|||
namespace detail { | |||
using unique_file = std::unique_ptr<FILE, decltype( &fclose )>; | |||
static void close_file(FILE* f) { |
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 believe inline
would be better here than static
.
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.
ah yep
Why not just replace the |
That caused a different warning for me (that to be honest I didn't investigate)
|
@@ -19,7 +19,11 @@ | |||
namespace fc { | |||
|
|||
namespace detail { | |||
using unique_file = std::unique_ptr<FILE, decltype( &fclose )>; | |||
inline void close_file(FILE* f) { |
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.
inline void close_file(FILE* f) { | |
inline void close_file(FILE* f) noexcept { |
latest glibc adds a
__nonnull
attribute onfclose()
which ends up causing a bunch of warnings,Not really sure the best way of fixing this. Simply wrapping the call like this gets rid of the warning.