-
Notifications
You must be signed in to change notification settings - Fork 23
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 several warnings #15
base: master
Are you sure you want to change the base?
Conversation
Martchus
commented
Dec 25, 2021
- Avoid implicit signedness conversions where possible
- Avoid c-style casts
- Avoid warnings about bypassing virtual dispatch in destructors
* Avoid implicit signedness conversions where possible * Avoid c-style casts
@ahupowerdns Could you take a look at this? |
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.
Instead of casting to void it is better to use [[maybe_unused]]
void put(MDBRWTransaction& txn, const Class& t, uint32_t id, unsigned int flags=0) | ||
{ | ||
(void)txn; | ||
(void)t; | ||
(void)id; | ||
(void)flags; | ||
} |
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.
void put(MDBRWTransaction& txn, const Class& t, uint32_t id, unsigned int flags=0) | |
{ | |
(void)txn; | |
(void)t; | |
(void)id; | |
(void)flags; | |
} | |
void put([[maybe_unused]] MDBRWTransaction& txn, [[maybe_unused]] const Class& t, [[maybe_unused]] uint32_t id, [[maybe_unused]] unsigned int flags=0) | |
{} |
I suppose when making that PR I didn't want to raise the C++ standard to 17 but yes, Note that this repository seems generally unmaintained so I wouldn't get my hopes up that this change is merged anytime soon. I personally just created a "custom" branch on my own fork (see https://github.com/Martchus/lmdb-safe). It is already 66 commits ahead of this one. I picked up some commits from pending PRs and did many adjustments myself. You might not want all changes from my branch but be sure to have a look. |
Thanks! Maybe @ahupowerdns can add you as a maintainer so you can take over the project. It would be great to keep this effort going. Alternatively, we can create a new organization and put the code there. |
Maybe. Note that I've introduced a dependency to https://github.com/Martchus/cpp-utilities because I didn't want to C&P lots of build system code. That could be problematic for some users (although the library is not a runtime dependency, it is just used for CMake modules and a few headers). I've also introduced usage of https://github.com/Martchus/reflective-rapidjson but that's only optional (you can still use any serialization you want). Some of my changes might also be API breaks. |