VLA issue on Windows

38 views
Skip to first unread message

Colin Doncaster

unread,
May 28, 2011, 2:59:12 PM5/28/11
to seexpr-...@googlegroups.com
Hey there -

Not a big deal, but I thought I'd point out that line 127 in SeNoise.cpp makes Microsofts Visual C++ unhappy as it doesn't conform to the C99 standard ( I believe it's C90 ).

As suggested by Microsoft, replacing line with
std::vector<T> vals(num)
works fine.

Cheers

Andrew Selle

unread,
May 28, 2011, 7:00:32 PM5/28/11
to seexpr-...@googlegroups.com
Could you try making the previous line const int num=1<<d; and see if it likes that? Otherwise I'd maybe a fix like T vals[1<<MAX_NOISE_DIM] to avoid a malloc on every noise instantiation.
-Andy

Colin Doncaster

unread,
May 28, 2011, 7:58:18 PM5/28/11
to seexpr-...@googlegroups.com
Hi Andrew, 

Adding the const seemed to have done the trick - I'm not too sure what the difference with or without the const means in this case but it seems like a more elegant solution.  

Cheers. 
Reply all
Reply to author
Forward
0 new messages