Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: mex compiling error
Date: Fri, 25 Sep 2009 15:51:03 +0000 (UTC)
Organization: Universit&#228;t Heidelberg
Lines: 14
Message-ID: <h9iot7$n89$1@fred.mathworks.com>
References: <h97rq1$3nc$1@fred.mathworks.com> <d102bc34-8206-4f28-b692-281de004e561@f33g2000vbm.googlegroups.com> <h9803b$fkp$1@fred.mathworks.com> <h984l4$ft2$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-03-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1253893863 23817 172.30.248.38 (25 Sep 2009 15:51:03 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Fri, 25 Sep 2009 15:51:03 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 869888
Xref: news.mathworks.com comp.soft-sys.matlab:572936


Dear James, dear Stephan!

> James Tursa wrote:
> P.S. Variable Length Arrays, where the array size is determined at run-time, *are* part of the current C Standard, but they are *not* part of the C++ standard. Having said that, many popular C compilers such as Microsoft Visual C (at least up to 8 ... I haven't tried 9 yet) and the lcc that ships with MATLAB, do not support Variable Length Arrays yet.

Apart from Rune's personal opinion about valid C-code, the current LCC 3.8.?  does support variable length arrays of the C99 standard:
  http://www.cs.virginia.edu/~lcc-win32/
Matlab R2009a (most likely 2009b also) does not recognize this LCC version automatically in "mex -setup", but it is easy to modify the mexopts.bat of the shipped LCC 2.4.1 (adjust the paths, disable the RSP-file support!). 

For an explanation about variable length arrays of the C99 standard see also:
  http://en.wikipedia.org/wiki/Variable-length_array
  http://www.ddj.com/cpp/184401444

Kind regards, Jan