[llvm-bugs] [Bug 32158] New: Program crashing due to missing return statement?

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Mar 6 14:12:01 PST 2017


            Bug ID: 32158
           Summary: Program crashing due to missing return statement?
           Product: new-bugs
           Version: 3.9
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: yaron.keren at gmail.com
                CC: llvm-bugs at lists.llvm.org

$ cat file1.cpp
int backend() {}
int main() { backend(); }

$ clang-3.9 file1.cpp ; ./a.out
file1.cpp:1:16: warning: control reaches end of non-void function
int backend() {}
1 warning generated.
Illegal instruction (core dumped)

$ clang-3.9 -v
clang version 3.9.0 (trunk 274529)

happens with clang version 5.0.0 (trunk 294982) too.
if this is valid (undefined?) behaviour, shouldn't the -Wreturn-type be an

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/20170306/e8c81d7c/attachment.html>

More information about the llvm-bugs mailing list