{"action":"opened","issue":{"url":"https://api.github.com/repos/casadi/casadi/issues/1695","repository_url":"https://api.github.com/repos/casadi/casadi","labels_url":"https://api.github.com/repos/casadi/casadi/issues/1695/labels{/name}","comments_url":"https://api.github.com/repos/casadi/casadi/issues/1695/comments","events_url":"https://api.github.com/repos/casadi/casadi/issues/1695/events","html_url":"https://github.com/casadi/casadi/issues/1695","id":134242289,"number":1695,"title":"Mex file generation broken","user":{"login":"jaeandersson","id":2487645,"avatar_url":"https://avatars.githubusercontent.com/u/2487645?v=3","gravatar_id":"","url":"https://api.github.com/users/jaeandersson","html_url":"https://github.com/jaeandersson","followers_url":"https://api.github.com/users/jaeandersson/followers","following_url":"https://api.github.com/users/jaeandersson/following{/other_user}","gists_url":"https://api.github.com/users/jaeandersson/gists{/gist_id}","starred_url":"https://api.github.com/users/jaeandersson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jaeandersson/subscriptions","organizations_url":"https://api.github.com/users/jaeandersson/orgs","repos_url":"https://api.github.com/users/jaeandersson/repos","events_url":"https://api.github.com/users/jaeandersson/events{/privacy}","received_events_url":"https://api.github.com/users/jaeandersson/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/casadi/casadi/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":{"login":"jaeandersson","id":2487645,"avatar_url":"https://avatars.githubusercontent.com/u/2487645?v=3","gravatar_id":"","url":"https://api.github.com/users/jaeandersson","html_url":"https://github.com/jaeandersson","followers_url":"https://api.github.com/users/jaeandersson/followers","following_url":"https://api.github.com/users/jaeandersson/following{/other_user}","gists_url":"https://api.github.com/users/jaeandersson/gists{/gist_id}","starred_url":"https://api.github.com/users/jaeandersson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jaeandersson/subscriptions","organizations_url":"https://api.github.com/users/jaeandersson/orgs","repos_url":"https://api.github.com/users/jaeandersson/repos","events_url":"https://api.github.com/users/jaeandersson/events{/privacy}","received_events_url":"https://api.github.com/users/jaeandersson/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/casadi/casadi/milestones/13","html_url":"https://github.com/casadi/casadi/milestones/Version%203.0","labels_url":"https://api.github.com/repos/casadi/casadi/milestones/13/labels","id":1072673,"number":13,"title":"Version 3.0","description":"Release 3.0 consolidates and extends the syntax changes from 2.4 and previous releases. With this release, CasADi should enter a new stage of maturity and hopefully stability.","creator":{"login":"jaeandersson","id":2487645,"avatar_url":"https://avatars.githubusercontent.com/u/2487645?v=3","gravatar_id":"","url":"https://api.github.com/users/jaeandersson","html_url":"https://github.com/jaeandersson","followers_url":"https://api.github.com/users/jaeandersson/followers","following_url":"https://api.github.com/users/jaeandersson/following{/other_user}","gists_url":"https://api.github.com/users/jaeandersson/gists{/gist_id}","starred_url":"https://api.github.com/users/jaeandersson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jaeandersson/subscriptions","organizations_url":"https://api.github.com/users/jaeandersson/orgs","repos_url":"https://api.github.com/users/jaeandersson/repos","events_url":"https://api.github.com/users/jaeandersson/events{/privacy}","received_events_url":"https://api.github.com/users/jaeandersson/received_events","type":"User","site_admin":false},"open_issues":2,"closed_issues":64,"state":"open","created_at":"2015-04-17T19:05:14Z","updated_at":"2016-02-17T10:29:39Z","due_on":"2016-01-31T23:00:00Z","closed_at":null},"comments":0,"created_at":"2016-02-17T10:29:39Z","updated_at":"2016-02-17T10:29:39Z","closed_at":null,"body":"Generation of MATLAB mex-file is broken\r\n\r\n```matlab\r\nimport casadi.*\r\n\r\nx = MX.sym('x', 3, 3);\r\ny = MX.sym('y');\r\nf = Function('f', {x,y}, {jacobian(sin(y), y), x*y});\r\n\r\nf.generate('mymex', struct('mex', true, 'main', true));\r\n\r\nmex('mymex.c')\r\n```\r\n\r\ngives:\r\n```\r\n/Users/jaeandersson/Desktop/codegen/mymex.c:220:18: warning: passing 'double *[2]' to parameter of type 'const double **' discards qualifiers in nested pointer types [-Wincompatible-pointer-types-discards-qualifiers]\r\n  i = mymex(arg, res, iw, w+20, 0);\r\n                 ^~~\r\n/Users/jaeandersson/Desktop/codegen/mymex.c:138:37: note: passing argument to parameter 'arg' here\r\nint mymex(void* mem, const real_t** arg, real_t** res, int* iw, real_t* w) {\r\n                                    ^\r\n/Users/jaeandersson/Desktop/codegen/mymex.c:220:23: warning: incompatible pointer types passing 'int [0]' to parameter of type 'double **' [-Wincompatible-pointer-types]\r\n  i = mymex(arg, res, iw, w+20, 0);\r\n                      ^~\r\n/Users/jaeandersson/Desktop/codegen/mymex.c:138:51: note: passing argument to parameter 'res' here\r\nint mymex(void* mem, const real_t** arg, real_t** res, int* iw, real_t* w) {\r\n                                                  ^\r\n/Users/jaeandersson/Desktop/codegen/mymex.c:220:27: warning: incompatible pointer types passing 'double *' to parameter of type 'int *' [-Wincompatible-pointer-types]\r\n  i = mymex(arg, res, iw, w+20, 0);\r\n                          ^~~~\r\n/Users/jaeandersson/Desktop/codegen/mymex.c:138:61: note: passing argument to parameter 'iw' here\r\nint mymex(void* mem, const real_t** arg, real_t** res, int* iw, real_t* w) {\r\n                                                            ^\r\n3 warnings generated.\r\n\r\nMEX completed successfully.\r\n```\r\n\r\nAlso, `mymex.c` instead of the `mymex` results in failing code."}}