[haiku-commits] Re: BRANCH midar-github.master - src/apps/terminal

  • From: Jonathan Schleifer <js-haiku-commits@xxxxxxxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Sun, 18 Nov 2012 21:44:49 +0100

Am 18.11.2012 um 21:38 schrieb Axel Dörfler:

> On 11/18/2012 09:34 PM, Axel Dörfler wrote:
>> On 11/18/2012 06:48 PM, midar-github.master wrote:
>>> -    UTF8Char pattern[patternByteLen];
>>> +    std::vector<UTF8Char> pattern(patternByteLen);
>> Out of curiosity: what's the problem here for clang?
> 
> Probably out of stupidity... is there an alloca()? That might be the better 
> choice for some of these issues, at least (or a fixed size array that's 
> always just large enough).

alloca() has the disadvantage of not calling the {c,d}tors.

See http://clang.llvm.org/compatibility.html#vla for what the Clang developers 
suggest as a replacement.

--
Jonathan

Other related posts: