On Tue, Dec 13, 2016 at 9:58 PM, Arne Goedeke el@laramies.com wrote:
On 12/13/16 00:33, Chris Angelico wrote:
I'm having trouble finding authoritative information on what VC9 supports (MS don't seem to carry much information on their older compilers - they carry precious little even on the current ones - so I'm depending on Stack Overflow), but it looks like VLAs are *not* supported. Sigh. So I guess I'll change it up. Should I go with alloca, or does Pike have its own preferred way to do this?
I know that alloca does not play well with longjmp. This is not a problem on all compilers, but specifically windows builds can break when using both in the same function. I suppose that C99 arrays are ok once they are correctly supported. I removed alloca from sprintf for instance some years ago because it could crash on windows. Use heap memory if you can.
*facepalm* Windows builds can break on anything. Okay. You know what? I have another solution. It's not like you're often going to need very many targets. Until C99 is supported, these now use a fixed-size buffer, and check the array length. So instead of risking a crash, they just limit you to ten in the incoming array.
ChrisA