Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.mixmin.net!news.albasani.net!fu-berlin.de!uni-berlin.de!news.dfncis.de!not-for-mail From: =?ISO-8859-1?Q?Hans-Bernhard_Br=F6ker?= Newsgroups: comp.std.c Subject: Re: VLAs use less stack Date: Tue, 04 Sep 2012 00:03:48 +0200 Lines: 14 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: news.dfncis.de MEwi49NyVQt33p2ASTQ8VQtPo1PRKnpLU51jchnYco5zfTwSd1xsACMcZ6sA0vob/2IXVKDZRA Cancel-Lock: sha1:58ZTXPa8cgw2UDNmtwnImA9t8PA= User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:13.0) Gecko/20120604 Thunderbird/13.0 In-Reply-To: Xref: csiph.com comp.std.c:1658 On 03.09.2012 00:45, John Nagle wrote: > If the program isn't recursive, and you do code coverage tests, > so that the worst case stack depth has been exercised, It's relatively easy to prove that this is impossible to achieve in the general case. Even without VLAs you run into problems as soon as you have function pointer variables involved, because trying to predict which functions those can possibly point to, short of actually running the program with all possible inputs, is generally equivalent to the Halting Problem. VLAs make that even more impossible, because even if you can build a known-complete call tree that still doesn't give you the actual stack size.