https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87951
Eric Gallager changed:
What|Removed |Added
See Also||https://gcc.gnu.org/bugzill
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87951
--- Comment #17 from Vitali ---
I was explicitly asked to open this as a separate bug in comment #7 of 87950.
Would be helpful if the GCC devs could coordinate to figure out if they want
separate bugs for C/C++ or 1 bug.
Jonathan, on this forum
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87951
--- Comment #16 from Jonathan Wakely ---
(In reply to Martin Sebor from comment #14)
> This is a duplicate of bug 87950, with most of the same discussion.
>
> *** This bug has been marked as a duplicate of bug 87950 ***
I think I need to add an
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87951
Eric Gallager changed:
What|Removed |Added
CC||egallager at gcc dot gnu.org
S
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87951
Martin Sebor changed:
What|Removed |Added
Status|UNCONFIRMED |RESOLVED
CC|
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87951
Jakub Jelinek changed:
What|Removed |Added
CC||jakub at gcc dot gnu.org
--- Comment #13
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87951
--- Comment #12 from Jonathan Wakely ---
It's not a useless warning. If I call your function from comment 7 like this, I
get undefined behaviour:
CoverMyBases( Enum{2} );
Your switch is undefined for this code. That's what GCC is warning you
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87951
--- Comment #11 from Askar Safin ---
(In reply to Jonathan Wakely from comment #10)
> I wish people would just learn how enums work, it's not that complicated.
Okey, now I understand everything. Now I see that, well, -fstrict-enums
silences warn
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87951
--- Comment #10 from Jonathan Wakely ---
No.
They're not "less strict", but they have a fixed underlying type. For any
enumeration type with a fixed underlying type (whether "enum class" or just
"enum") the validvalues of the type are all the va
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87951
--- Comment #9 from Askar Safin ---
(In reply to Andrew Pinski from comment #8)
> Yes because they have different semantics ...
So, you mean that "enum class" is less strict than normal enums? This is very
strange.
Today I normally use "enum cl
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87951
--- Comment #8 from Andrew Pinski ---
(In reply to Askar Safin from comment #7)
> "g++ -fstrict-enums" doesn't disable warning if I use "enum class" instead
> of plain enum.
Yes because they have different semantics ...
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87951
Askar Safin changed:
What|Removed |Added
CC||safinaskar at mail dot ru
--- Comment #7 f
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87951
--- Comment #6 from Jonathan Wakely ---
(In reply to Vitali from comment #5)
> Jonathan, I think the defect report here does actually apply to this
> example.
I didn't say otherwise.
> I agree the argument could be made that if there's gaps in
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87951
--- Comment #5 from Vitali ---
Jonathan, I think the defect report here does actually apply to this example. I
agree the argument could be made that if there's gaps in the enum values that
it's arguable that the current GCC behaviour is standards
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87951
--- Comment #4 from Vitali ---
Is there a way to annotate a specific enum as strict?
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87951
--- Comment #3 from Jonathan Wakely ---
(In reply to Vitali from comment #0)
> If a function has a single switch statement that handles all enum values &
> returns a value GCC will warn about the function not returning a value
> whereas clang doe
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87951
--- Comment #2 from Martin Liška ---
One more comment here. I do cooperate with our openSUSE maintainer of Chromium
package and they have quite some of these warnings when building with GCC. I
told him he can strengthen behavior with -fstrict-enu
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87951
Martin Liška changed:
What|Removed |Added
Last reconfirmed||2018-11-9
CC|
18 matches
Mail list logo