[LLVMbugs] [Bug 19074] New: -Wreturn-type regression

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Mar 6 22:30:57 PST 2014


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

            Bug ID: 19074
           Summary: -Wreturn-type regression
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: ismail at donmez.ws
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Given the following code

#include <stdlib.h>

#define av_assert0(cond) do {                                           \
    if (!(cond)) {                                                      \
        abort();                                                        \
    }                                                                   \
} while (0)

int f(int x) {
    switch(x) {
        case 0:
            return 0;
        default:
            av_assert0(0);
    }
}

int main()
{
}

[/havana/t]> clang --version
clang version 3.4 (branches/release_34 198681)
Target: x86_64-suse-linux
Thread model: posix
[/havana/t]> clang -Wall -Wreturn-type t.c
[/havana/t]> 

No warnings. With recent trunk:

[/havana/t]> clang -v 
clang version 3.5.0 (trunk 202995)
[/havana/t]> clang -Wall -Wreturn-type t.c
t.c:16:1: warning: control may reach end of non-void function [-Wreturn-type]
}
^
1 warning generated.

So looks like clang is no longer recognizing abort being a __noreturn__
function.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20140307/6bbccbf1/attachment.html>


More information about the llvm-bugs mailing list