From: Arnd Bergmann <arnd@arndb.de>
To: Ilya Dryomov <idryomov@gmail.com>
Cc: Zheng Yan <zyan@redhat.com>, Sage Weil <sage@redhat.com>,
gregkh <gregkh@linuxfoundation.org>,
Philippe Ombredanne <pombredanne@nexb.com>,
lhenriques@suse.com, ceph-devel <ceph-devel@vger.kernel.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] ceph: use an enum instead of 'static const' to define constants
Date: Mon, 8 Oct 2018 17:37:19 +0200 [thread overview]
Message-ID: <CAK8P3a0xpFdKC0AtBDC9UvMfwpx3HTbAdio4ApmYhrb2FakK9g@mail.gmail.com> (raw)
In-Reply-To: <CAOi1vP8Wy0DjEWBWh05iSx-RJS41hTc1rs2TXdz_1mcNpf68Dg@mail.gmail.com>
On Mon, Oct 8, 2018 at 4:23 PM Ilya Dryomov <idryomov@gmail.com> wrote:
> On Fri, Oct 5, 2018 at 6:18 PM Arnd Bergmann <arnd@arndb.de> wrote:
> > @@ -71,7 +71,7 @@
> > * This ensures that no two versions who have different meanings for
> > * the bit ever speak to each other.
> > */
> > -
> > +enum ceph_features {
> > DEFINE_CEPH_FEATURE( 0, 1, UID)
> > DEFINE_CEPH_FEATURE( 1, 1, NOSRCADDR)
> > DEFINE_CEPH_FEATURE_RETIRED( 2, 1, MONCLOCKCHECK, JEWEL, LUMINOUS)
> > @@ -170,13 +170,13 @@ DEFINE_CEPH_FEATURE(61, 1, CEPHX_V2) // *do not share this bit*
> >
> > DEFINE_CEPH_FEATURE(62, 1, RESERVED) // do not use; used as a sentinal
> > DEFINE_CEPH_FEATURE_DEPRECATED(63, 1, RESERVED_BROKEN, LUMINOUS) // client-facing
> > -
> > +};
>
> I don't particularly like this because it looks like lower constants
> are actually ints and the rest are unsigned longs, even though they all
> have ULL suffixes. The standard seems to require that enum constants
> be representable as ints, is the non-pedantic behaviour documented
> somewhere?
I had not realized that this is a gcc extension, or that it behaves slightly
differently from the standard C++ behavior that apparently adopted a
saner variant (all values in an enum have the same type).
How about we just add a __maybe_unused to DEFINE_CEPH_FEATURE
then to shut up the warning?
Arnd
next prev parent reply other threads:[~2018-10-08 15:37 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-05 16:18 Arnd Bergmann
2018-10-08 14:22 ` Ilya Dryomov
2018-10-08 15:37 ` Arnd Bergmann [this message]
2018-10-08 16:00 ` Ilya Dryomov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAK8P3a0xpFdKC0AtBDC9UvMfwpx3HTbAdio4ApmYhrb2FakK9g@mail.gmail.com \
--to=arnd@arndb.de \
--cc=ceph-devel@vger.kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=idryomov@gmail.com \
--cc=lhenriques@suse.com \
--cc=linux-kernel@vger.kernel.org \
--cc=pombredanne@nexb.com \
--cc=sage@redhat.com \
--cc=zyan@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®