This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug sanitizer/81275] [5/6/7/8 Regression] -fsanitize=thread produce incorrect -Wreturn-type warning
- From: "mpolacek at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 26 Jul 2017 11:49:55 +0000
- Subject: [Bug sanitizer/81275] [5/6/7/8 Regression] -fsanitize=thread produce incorrect -Wreturn-type warning
- Auto-submitted: auto-generated
- References: <bug-81275-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81275
--- Comment #5 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
(In reply to Jakub Jelinek from comment #4)
> Marek, could we reuse the fallthrough warning infrastructure for this to
> determine whether there is a possible fallthrough or not?
> Though, trying:
> int
> foo (int a, int b, int c)
> {
> switch (c)
> {
> case 5:
> switch (a)
> {
> case 0:
> switch (b)
> {
> default:
> return 0;
> }
> break;
> #ifdef FT
> case 7:
> break;
> #endif
> default:
> return 0;
> }
> case 6:
> return 7;
> }
> return 8;
> }
>
> we don't warn about the fallthrough from case 5 to case 6 no matter if FT is
> defined (in that case there is obvious fallthrough, say for foo (7, 0, 5), or
> when FT is not defined (then there isn't, but gimple_seq_may_fallthru
> doesn't know that).
Unfortunately, not yet, because -Wimplicit-fallthrough doesn't scan nested
switches (PR79153).