# HG changeset patch # User Rik # Date 1473376447 25200 # Node ID 3a8af9d517de488e3d086c77e1d0556f61960e9f # Parent ad5439817753f9f70e0d6cf7213e268e5c701649 Initialize MEX TrapFlag variable for Matlab compatibility. * NEWS: Announce change. * mex.cc: Declare trap_feval_error as an int and initialize to 0. diff -r ad5439817753 -r 3a8af9d517de NEWS --- 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 diff -r ad5439817753 -r 3a8af9d517de libinterp/corefcn/mex.cc --- 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: