changeset 18127:d96747f74b1e gui-release

enable "backtrace" warning by default and document option * error.cc (Vbacktrace_on_warning): Initialize to true. (Fwarning): Describe "backtrace" option.
author John W. Eaton <jwe@octave.org>
date Wed, 11 Dec 2013 20:58:30 -0500
parents d76f790b4eec
children 4a4897cd6da1
files NEWS libinterp/corefcn/error.cc
diffstat 2 files changed, 10 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/NEWS	Wed Dec 11 20:51:22 2013 -0500
+++ b/NEWS	Wed Dec 11 20:58:30 2013 -0500
@@ -1,6 +1,9 @@
 Summary of important user-visible changes for version 4.0:
 ---------------------------------------------------------
 
+ ** For compatibility with Matlab, the "backtrace" warning option is now
+    enabled by default.
+
  ** The preference
 
       do_braindead_shortcircuit_evaluation
--- a/libinterp/corefcn/error.cc	Wed Dec 11 20:51:22 2013 -0500
+++ b/libinterp/corefcn/error.cc	Wed Dec 11 20:58:30 2013 -0500
@@ -61,7 +61,7 @@
 
 // TRUE means that Octave will try to display a stack trace when a
 // warning is encountered.
-static bool Vbacktrace_on_warning = false;
+static bool Vbacktrace_on_warning = true;
 
 // TRUE means that Octave will print a verbose warning.  Currently unused.
 static bool Vverbose_warning;
@@ -1225,6 +1225,7 @@
 @deftypefnx {Built-in Function} {} warning (\"off\", @var{id})\n\
 @deftypefnx {Built-in Function} {} warning (\"query\", @var{id})\n\
 @deftypefnx {Built-in Function} {} warning (\"error\", @var{id})\n\
+@deftypefnx {Built-in Function} {} warning (@var{state}, \"backtrace\")\n\
 @deftypefnx {Built-in Function} {} warning (@var{state}, @var{id}, \"local\")\n\
 Format the optional arguments under the control of the template string\n\
 @var{template} using the same rules as the @code{printf} family of\n\
@@ -1255,6 +1256,11 @@
 @end group\n\
 @end example\n\
 \n\
+If the state is @qcode{\"on\"} or @qcode{\"off\"} and the third argument\n\
+is @qcode{\"backtrace\"}, then a stack trace is printed along with the\n\
+warning message when warnings occur inside function calls.  This option\n\
+is enabled by default.\n\
+\n\
 If the state is @qcode{\"on\"}, @qcode{\"off\"}, or @qcode{\"error\"}\n\
 and the third argument is @qcode{\"local\"}, then the warning state\n\
 will be set temporarily, until the end of the current function.\n\