[Bug sanitizer/86899] [8/9 regression] TSAN incorrect warning: control reaches end of non-void function

jakub at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed Nov 21 18:02:00 GMT 2018


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86899

--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Doesn't seem to be a real regression to me, we've only stopped warning about
this with -Wreturn-type -fsanitize=thread in r254437 and started again in
r255403, that is less than month and no releases have been released with that.
We weren't warning before r219202 though.

Note, it is the same warning you get with e.g.
struct A { A (); ~A (); };
int foo()
{
    A a;
    return 0;
    if(0) {
        return 0;
    }
}
or anything that needs a cleanup, -Wreturn-type is a simple warning and if you
try hard to screw it up, you'll manage to do it.  Any reason why we shouldn't
warn on this though?  It is clearly useless dead code that is better removed
when the compiler warns about it...


More information about the Gcc-bugs mailing list