changeset 22452:3a8af9d517de

Initialize MEX TrapFlag variable for Matlab compatibility. * NEWS: Announce change. * mex.cc: Declare trap_feval_error as an int and initialize to 0.
author Rik <rik@octave.org>
date Thu, 08 Sep 2016 16:14:07 -0700
parents ad5439817753
children ca01dc025e2c
files NEWS libinterp/corefcn/mex.cc
diffstat 2 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/NEWS	Thu Sep 08 16:01:33 2016 -0700
+++ b/NEWS	Thu Sep 08 16:14:07 2016 -0700
@@ -133,6 +133,10 @@
     literally grab the HTML published code from a remote website, for
     example.
 
+ ** The value of the MEX variable TrapFlag now defaults to 0, which will
+    cause Octave to abort execution of a MEX file and return to the
+    prompt if an error is encountered in mexCallMATLAB.
+
  ** The MEX API now includes the function mexCallMATLABWithTrap.  This
     function will not abort if an error occurs during mexCallMATLAB, but
     instead will return execution to the MEX function for error
--- a/libinterp/corefcn/mex.cc	Thu Sep 08 16:01:33 2016 -0700
+++ b/libinterp/corefcn/mex.cc	Thu Sep 08 16:14:07 2016 -0700
@@ -2246,7 +2246,7 @@
   }
 
   // 1 if error should be returned to MEX file, 0 if abort.
-  int trap_feval_error;
+  int trap_feval_error = 0;
 
 private: