[LLVMbugs] [Bug 7223] -fcatch-undefined-behaviour doesn't catch missing return values

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri Dec 28 05:27:23 PST 2012


Dmitri Gribenko <gribozavr at gmail.com> changed:

           What    |Removed                     |Added
             Status|NEW                         |RESOLVED
                 CC|                            |gribozavr at gmail.com
         Resolution|                            |FIXED

--- Comment #2 from Dmitri Gribenko <gribozavr at gmail.com> 2012-12-28 07:27:23 CST ---
Richard Smith implemented this (at least since r165533):

$ cat /tmp/z.cc
int foo() {}

int main() {

$ clang -fsanitize=undefined /tmp/z.cc
/tmp/z.cc:1:12: warning: control reaches end of non-void function
int foo() {}
1 warning generated.

$ ./a.out 
/tmp/z.cc:1:5: runtime error: execution reached the end of a value-returning
function without returning a value

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