Skip to content

Commit 5ec2050

Browse files
committed
chore(Connection): Fix warning due to non-void function not returning
In release builds, the assert is omitted and the function shows undefined behavior due to not returning. We now return nullptr to avoid UB; in general we expect developers to build in non-release mode, and to encounter the assert when code wrongly dispatches to this function.
1 parent 039c7d0 commit 5ec2050

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

nestkernel/connection.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,8 @@ template < typename targetidentifierT >
402402
SecondaryEvent*
403403
Connection< targetidentifierT >::get_secondary_event()
404404
{
405-
assert( false );
405+
assert( false && "non-primary connections have to provide get_secondary_event()");
406+
return nullptr;
406407
}
407408

408409
} // namespace nest

0 commit comments

Comments
 (0)