Hey Folks,

So I've been wondering about variable length arrays from c99 for a while 
now. They seem to me like a good way to avoid lots of trivial calls to 
malloc/free at least for smaller arrays that aren't going to blow up the 
stack. That said I don't see them being used.

The promise of them seems to be 'easy', dynamic, stack allocated memory and 
improved readability. That said, using vla's avoids the work on malloc that 
creates a hostile (strict) environment, like junking and whatnot. Also there 
is the portability stuff, I'm not sure if all the platforms that openbsd 
runs on are using a compiler that supports them yet.

gcc 4.2 in base seems to support them well enough, though I note that the 
gcc website says that some corner cases were fixed in version 4.5 which I 
haven't investigated yet.

So what do you guys think? VLA's, are they good, bad, evil, stupid, all of 
the above?

-- 
Ted Bullock

Reply via email to