From 6b3a8915f3c50f7220121fcb9202ec20144389c4 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Fri, 14 Nov 2014 10:47:43 +0100 Subject: add abort() to non-reached code MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This cleans up a lot of false-positives in static analysis and also helps compilers to optimize code paths in general. (tagging the fatal stingstream operator as ‘noreturn’ is far less trivial) --- gtk2_ardour/selection.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'gtk2_ardour/selection.cc') diff --git a/gtk2_ardour/selection.cc b/gtk2_ardour/selection.cc index 507245eb3d..1bdc0fe8b0 100644 --- a/gtk2_ardour/selection.cc +++ b/gtk2_ardour/selection.cc @@ -1002,7 +1002,7 @@ Selection::toggle (list const & selectables) fatal << _("programming error: ") << X_("unknown selectable type passed to Selection::toggle()") << endmsg; - /*NOTREACHED*/ + abort(); /*NOTREACHED*/ } } @@ -1056,7 +1056,7 @@ Selection::add (list const & selectables) fatal << _("programming error: ") << X_("unknown selectable type passed to Selection::add()") << endmsg; - /*NOTREACHED*/ + abort(); /*NOTREACHED*/ } } -- cgit v1.2.3