[Bug middle-end/60725] [-Wreturn-type] false positive in trivial switch
mferoldif at gmail dot com
gcc-bugzilla@gcc.gnu.org
Mon Feb 19 13:32:00 GMT 2018
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60725
Mário Feroldi <mferoldif at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |mferoldif at gmail dot com
--- Comment #9 from Mário Feroldi <mferoldif at gmail dot com> ---
Note that this version of `f1` doesn't prevent the warning. I wonder why?
enum E { E1 };
static inline int f1(enum E e) {
(e == E1) ? void() : __builtin_unreachable(); // *
switch (e) {
case E1: return 1;
}
}
int main () {
f1(E1);
return 0;
}
More information about the Gcc-bugs
mailing list