octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #54096] mxCreateStructMatrix with a NULL argum


From: Julien Bect
Subject: [Octave-bug-tracker] [bug #54096] mxCreateStructMatrix with a NULL argument creates a "corrupt" structure
Date: Mon, 11 Jun 2018 13:29:03 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Firefox/52.0

Follow-up Comment #7, bug #54096 (project octave):

The patch solves the problem in the particular case that I initially
described, but not from a more general perspective.

Indeed, mxCreateStructArray and mxCreateStructMatrix still create structures
initialized with NULL pointers (as they are supposed to, according the
Matlab's documentation).

Consider then the following example:


#include "mex.h"

static const char* field_names[] = {"dudule"};

void mexFunction (int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
{  
  if (nlhs > 1)   /* Check number of output arguments */
    mexErrMsgTxt ("Too many output arguments.");

  plhs[0] = mxCreateStructMatrix (1, 1, 1, field_names);
}


In Matlab this is OK, but in Octave 4.4 it results in the same problem as in
my original post.



    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?54096>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]