public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* gcc warn C++ implicit enum conversion
@ 2019-07-01 22:40 Jonny Grant
  2019-07-02  7:47 ` Jonathan Wakely
  0 siblings, 1 reply; 3+ messages in thread
From: Jonny Grant @ 2019-07-01 22:40 UTC (permalink / raw)
  To: gcc-help

Hi
Is there any way to warn on enum conversion to int? I tried few options, 
but no warning seems possible.

Cheers, Jonny

//-O2 -Wall -Wextra -Wconversion -Werror

#include <cstddef>
typedef enum
{
     a = -1
} a_t;

a_t f()
{
     return a;
}

int main()
{
     int b = f();
     return b;
}

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-07-02  9:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-01 22:40 gcc warn C++ implicit enum conversion Jonny Grant
2019-07-02  7:47 ` Jonathan Wakely
2019-07-02  9:24   ` Jonny Grant

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).