bugGNU Octave - Bugs: bug #40984, MEX function should be able to...

 
 

bug #40984: MEX function should be able to return status as output

Submitter:  Ben Kurtz <bkurtz>
Submitted:  Sun 22 Dec 2013 07:26:08 AM UTC
   
 
Category:  Octave Function Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Matlab Compatibility
Status:  Fixed Assigned to:  None
Originator Name:  Open/Closed:  * Closed
Release:  * dev Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Thu 02 Jan 2014 07:34:33 PM UTC, comment #3: 

It was more complicated than I initially thought, but still not too difficult.  I committed a fix here (http://hg.savannah.gnu.org/hgweb/octave/rev/d3c6842ef188).

Rik <rik5>
Group administrator
Sun 29 Dec 2013 03:21:19 AM UTC, comment #2: 

Ah yeah, that sounds right.  I forgot about that.  I assume that's a trivial enough modification that whoever commits it can take care of it, rather than me needing to upload a new patch...

Ben Kurtz <bkurtz>
Sat 28 Dec 2013 07:47:35 PM UTC, comment #1: 

When you call mex without a return argument, and without a trailing ';', is the status returned in Matlab?

If not, I think the patch needs to be amended to something like


[~, retval] = mkoctfile ...
if (nargout > 0)
  status = retval;
endif


Rik <rik5>
Group administrator
Sun 22 Dec 2013 07:26:08 AM UTC, original submission:  

It's not documented, but matlab returns the build status as the first output to mex if one is requested.  Since octave's mex uses mkoctfile, which already returns a status, this is quite a trivial feature to add.  See attached patch for example.

Ben Kurtz <bkurtz>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #30062:  mex.patch added by bkurtz (412B - application/octet-stream)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by bkurtz (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2014-01-02 rik5 StatusPatch Submitted Fixed
        Open/ClosedOpen Closed
    2013-12-28 rik5 StatusNone Patch Submitted
    2013-12-22 bkurtz Attached File- Added mex.patch, #30062

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code