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: Tue, 13 Mar 2018 14:36:31 -0700 Organization: None to speak of Lines: 45 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="a9638e2b58572a27edc6516887e5eee0"; logging-data="17697"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+XGVJYX9Shrp4VkW3ohb97" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:fZyjjLU+FYWI7tdM5IBhc9UG3fQ= sha1:bflQw31IK3ohYYeFWg0RC/tvcC8= Xref: csiph.com comp.lang.c:127780 bartc writes: [...] > A longer example is given below. Results are as follows: > > Compiles? Runs? (using fred(10)) > > Pelles C No --- > Lccwin Yes Crashes (or bad results without copy test) > DMC No --- > Tiny C Yes Crashes > MSVC No --- > gcc 5.1.0 Yes Yes > clang No --- (via rextester.com) > mcc No --- (my product) > > > So only one compiler out of 7 or 8 fully supports a feature that you say > is so easy to implement; funny, that. > > Or rather, 'not difficult' (so what /is/ difficult in your opinion?) > > (Here, I've hardly got started with the complexities of VLAs, like > multiple-dimensional VLAs of my VLA D type and allocating them in loops.) > > ------------------------------------- > > void fred(int n){ > typedef struct {int A[n],B[n/2],C[n*2];} D; [SNIP] > } N1570 6.7.2.1p9: A member of a structure or union may have any complete object type other than a variably modified type. Apparently gcc supports VLA members as an extension. clang does not. You could have avoided this error if you know how to invoke compilers in conforming mode. -- 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"