[LLVMbugs] [Bug 11542] New: -Wreturn-type should be able to derive _Noreturn indirectly

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon Dec 12 01:35:31 PST 2011


http://llvm.org/bugs/show_bug.cgi?id=11542

             Bug #: 11542
           Summary: -Wreturn-type should be able to derive _Noreturn
                    indirectly
           Product: clang
           Version: 3.0
          Platform: PC
        OS/Version: FreeBSD
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: -New Bugs
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: ed at 80386.nl
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified


I suspect this bug is similar to bug 9599, but not identical, so I'm filing
this anyway.

The following code generates a -Wreturn-type warning:

__attribute__((__noreturn__)) void bar(void);

static void
foo(void)
{

        bar();
}

int
f(void)
{

        foo();
}


foo.c:15:1: warning: control reaches end of non-void function [-Wreturn-type]

If I change the call to foo() to bar(), it obviously work, but in this case the
compiler should be to derive to a certain extent that foo() isn't going to
return anyway. This information should be available anyway, as for this
specific C file, foo() is even inlined into bar() completely.

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list