Mercurial > jwe > octave
changeset 20777:29861f5f28c5
avoid defined but not used warning in error.cc
* error.cc (debug_or_throw_exception (bool)): Delete.
(usage_1 (const char *, const char *, va_list)): Create
octave_execution_exception object and call usage_1 (const
octave_execution_exception&, const char *, const char *, va_list).
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Mon, 30 Nov 2015 09:15:58 -0500 |
parents | 38968777601b |
children | 8513c84a13cb |
files | libinterp/corefcn/error.cc |
diffstat | 1 files changed, 2 insertions(+), 18 deletions(-) [+] |
line wrap: on
line diff
--- a/libinterp/corefcn/error.cc Sun Nov 29 19:58:52 2015 +1100 +++ b/libinterp/corefcn/error.cc Mon Nov 30 09:15:58 2015 -0500 @@ -306,22 +306,6 @@ throw e; } -static void -debug_or_throw_exception (bool show_stack_trace = false) -{ - octave_execution_exception e; - - if (show_stack_trace && octave_exception_state != octave_exec_exception) - { - std::ostringstream buf; - pr_where (buf, "error"); - - e.set_stack_trace (buf.str ()); - } - - debug_or_throw_exception (e, show_stack_trace); -} - // Warning messages are never buffered. static void @@ -402,9 +386,9 @@ static void usage_1 (const char *id, const char *fmt, va_list args) { - verror (true, std::cerr, "usage", id, fmt, args); + octave_execution_exception e; - debug_or_throw_exception (); + usage_1 (e, id, fmt, args); } void