Path: csiph.com!eternal-september.org!feeder.eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail From: Keith Thompson Newsgroups: comp.lang.c Subject: Re: Future of C Date: Mon, 12 Mar 2018 16:24:43 -0700 Organization: None to speak of Lines: 31 Message-ID: References: <0231327b-9e28-46e4-9178-46c881a8dd91@googlegroups.com> <20180310180016.eda9bc36e1a3b182bc2563a8@gmail.com> <20180311000302.8e7cd15242a818ab75eb2e98@gmail.com> <83527acf-abed-4f8f-878c-7d4db9cd5ac1@googlegroups.com> <20180311161525.ac591de531b83d6b14b2cd43@gmail.com> <90236828-48d7-4ee5-9b86-4cedd0e29b5f@googlegroups.com> <3r7jne-t3h.ln1@gangtai.grep.be> <8e201938-ada4-42d9-8ae6-13b1047306e2@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: reader02.eternal-september.org; posting-host="877122f47cb3293e34ad9ed0b03f90bc"; logging-data="13764"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX182e3HtCV3oLL/etdbWcEkM" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:SniOP+QSGPHR96sxNEsxZK1NOyo= sha1:cZjHpOu84UjnE8IoocXoTdP4xek= Xref: csiph.com comp.lang.c:127720 supercat@casperkitty.com writes: [...] > At present the semantics of creating an object of VLA type (as opposed > to merely defining such a type and then creating a pointer to one) seem > a bit too vague to really be useful. From the point of view of the > Standard, would a conforming implementation ever be required to actually > allocate a meaningful amount of space for a VLA? The Standard offers > no guidance whatsoever about what sizes of requests implementations should > be expected to handle, nor about what implementations should do if a > request would be too big. How are programmers supposed to judge whether a > VLA declaration of a given size would be reasonable? Take the above paragraph and replace each occurrence of VLA by constant-length array. #define SOME_BIG_NUMBER /*...*/ void func1(void) { int fixed_array[SOME_BIG_NUMBER]; } void func2(void) { size_t var = SOME_BIG_NUMBER; int vla[var]; } -- Keith Thompson (The_Other_Keith) kst-u@mib.org Working, but not speaking, for JetHead Development, Inc. "We must do something. This is something. Therefore, we must do this." -- Antony Jay and Jonathan Lynn, "Yes Minister"