From: Jonny Grant <jg@jguk.org>
To: Jonathan Wakely <jwakely.gcc@gmail.com>
Cc: gcc-help <gcc-help@gcc.gnu.org>
Subject: Re: gcc warn C++ implicit enum conversion
Date: Tue, 02 Jul 2019 09:24:00 -0000 [thread overview]
Message-ID: <9fa3e28e-34f4-c7f7-6849-eb0c4134310c@jguk.org> (raw)
In-Reply-To: <CAH6eHdTJw=oHOvzvdtVF=RpGgSqg83kyGCHnwZNW4v1L7tg9Pg@mail.gmail.com>
On 02/07/2019 08:47, Jonathan Wakely wrote:
> On Mon, 1 Jul 2019 at 23:40, Jonny Grant wrote:
>>
>> Hi
>> Is there any way to warn on enum conversion to int?
>
> I don't think so.
>
> I'd just use 'enum class' so the conversion is forbidden, and insert
> explicit casts where you want the conversion to compile.
>
Thank you. I better update codebase to use 'enum class' to get these
warnings.
Thanks, Jonny
prev parent reply other threads:[~2019-07-02 9:24 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-01 22:40 Jonny Grant
2019-07-02 7:47 ` Jonathan Wakely
2019-07-02 9:24 ` Jonny Grant [this message]
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=9fa3e28e-34f4-c7f7-6849-eb0c4134310c@jguk.org \
--to=jg@jguk.org \
--cc=gcc-help@gcc.gnu.org \
--cc=jwakely.gcc@gmail.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).