cpp: Avoid missing returns in non-void functions