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
include/denc, kv: silence gcc warnings #13458
Conversation
5536617
to
be290dc
Compare
@@ -170,9 +170,9 @@ struct denc_traits { | |||
#define WRITE_RAW_DENC(type) \ | |||
template<> \ | |||
struct denc_traits<type> { \ | |||
enum { supported = 2 }; \ | |||
enum { featured = false }; \ |
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.
Run this past Sage. From the comments it looks like he did this to prevent some sort of clash with encode/decode, so don't remove it without his imprimatur.
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.
@liewegas do we have a test to reproduce the clash? if yes, so does "make check" proves that we are immune from it now? if not, could you enlighten me how to create a reproducer? thanks.
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.
2 has a special meaning separate from 1/true
// NOTE: set supported == 2 instead of true. This prevents these from
// getting glued into the legacy encode/decode methods; the overhead
// of setting up a contiguous_appender etc is likely to be slower.
Instead of changing the types, how about using |
be290dc
to
77c0277
Compare
i am not sure i understand the "clash" here. but i am trying to clarify my understanding. please see § 14.5.6.2 in n3337 [1],
so the plain (the legacy encode/decode) functions won't clash with the ones defined using the templates or i think this all about how the overload resolution works in C++. see § 13.3.3/1 in n3337 [1],
and i also write a small test to verify this behavior. could you take a look again? thanks. [1] http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2012/n3337.pdf |
gcc-7 complains: ceph/ceph/src/include/denc.h:469:50: warning: enum constant in boolean context [-Wint-in-bool-context] inline typename std::enable_if<traits::supported && ~~~~~~~~~~~~~~~~~~^~ traits::featured>::type denc( ~~~~~~ so let's use "static constexpr bool" instead of enum. Signed-off-by: Kefu Chai <kchai@redhat.com>
this silences the warnings like ceph/ceph/src/kv/KeyValueDB.h:59:18: warning: ‘virtual void KeyValueDB::TransactionImpl::set(const string&, const char*, size_t, const bufferlist&)’ was hidden [-Woverloaded-\ virtual] virtual void set( ^~~ Signed-off-by: Kefu Chai <kchai@redhat.com>
77c0277
to
7251ea5
Compare
Laminators Glue Things Methodically. |
No description provided.