lmi
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lmi] [lmi-commits] master 4b0c2ee 4/6: Remove an unreachable statem


From: Vadim Zeitlin
Subject: Re: [lmi] [lmi-commits] master 4b0c2ee 4/6: Remove an unreachable statement
Date: Fri, 3 Mar 2017 15:31:51 +0100

On Tue, 28 Feb 2017 22:02:58 -0500 (EST) Greg Chicares <address@hidden> wrote:

GC> branch: master
GC> commit 4b0c2eeb402a36b63038f604ab8fe4b37ca5be7d
GC> Author: Gregory W. Chicares <address@hidden>
GC> Commit: Gregory W. Chicares <address@hidden>
GC> 
GC>     Remove an unreachable statement
GC>     
GC>     fatal_error() always throws. Writing 'return' after it was just
GC>     confusing. (Elsewhere in lmi, this usage is seen:
GC>       throw "Unreachable--silences a compiler diagnostic.";
GC>     but there is no diagnostic to silence here.)
GC> ---
GC>  input_sequence_entry.cpp | 1 -
GC>  1 file changed, 1 deletion(-)
GC> 
GC> diff --git a/input_sequence_entry.cpp b/input_sequence_entry.cpp
GC> index 4cfabc9..68d2a5a 100644
GC> --- a/input_sequence_entry.cpp
GC> +++ b/input_sequence_entry.cpp
GC> @@ -528,7 +528,6 @@ std::string InputSequenceEditor::sequence_string()
GC>              case e_inforce:
GC>                  {
GC>                  fatal_error() << "unexpected duration_mode value" << 
LMI_FLUSH;
GC> -                return "";
GC>                  }
GC>                  break;
GC>              }

 fatal_error() should really be marked with [[noreturn]] attribute, now
that we use C++11. And if/when we do it, at least some compilers probably
will warn about "break" here being unreachable, so it should be removed.

 Regards,
VZ


reply via email to

[Prev in Thread] Current Thread [Next in Thread]