Skip to content

Commit f49fd03

Browse files
committed
[cling] Treat -Wreturn-type as an error
Cling currently crashes when a non-void function is missing a return, upgrade this warning to an error.
1 parent a075a71 commit f49fd03

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

interpreter/cling/lib/Interpreter/CIFactory.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1422,6 +1422,11 @@ namespace {
14221422
argvCompile.push_back("-fno-omit-frame-pointer");
14231423
}
14241424

1425+
// Promote -Wreturn-type to an error. A missing return in a non-void
1426+
// function is a warning by default, and cling cannot safely continue and
1427+
// crashes later.
1428+
argvCompile.push_back("-Werror=return-type");
1429+
14251430
#ifdef CLING_WITH_ADAPTIVECPP
14261431
argvCompile.push_back("-D__ACPP_ENABLE_LLVM_SSCP_TARGET__");
14271432
argvCompile.push_back("-Xclang");

0 commit comments

Comments
 (0)