mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 06:38:20 +00:00
tweak to prevent an incorrect warning for scripts compiled to C++
This commit is contained in:
parent
ed905c33cd
commit
8025ee74ef
1 changed files with 5 additions and 0 deletions
|
@ -369,6 +369,11 @@ void CPPCompile::GenWhenStmt(const WhenInfo* wi, const std::string& when_lambda,
|
|||
Emit("\tthrow CPPDelayedCallException();");
|
||||
Emit("return %s;", GenericValPtrToGT("retval", ret_type, GEN_NATIVE));
|
||||
EndBlock();
|
||||
|
||||
// Return something to avoid return-without-value warnings - but not
|
||||
// if this is a when-inside-a-when, or a hook.
|
||||
if ( ! func_type->ExpressionlessReturnOkay() && ! in_hook )
|
||||
Emit("return 0;");
|
||||
}
|
||||
|
||||
Emit("}");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue