Path: ...!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!eternal-september.org!.POSTED!not-for-mail From: Michael S Newsgroups: comp.lang.c Subject: Re: Two questions on arrays with size defined by variables Date: Sun, 9 Feb 2025 20:19:02 +0200 Organization: A noiseless patient Spider Lines: 13 Message-ID: <20250209201902.000019e5@yahoo.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Injection-Date: Sun, 09 Feb 2025 19:19:03 +0100 (CET) Injection-Info: dont-email.me; posting-host="8e2d9f7cf4b47825ab2c863bbd44b8cd"; logging-data="802523"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+qHaOR7RhyGdpYjwx6fSPwPAWz6Nt9Tnk=" Cancel-Lock: sha1:JMPHbLloAZBMLIU88qblRHg8Jvw= X-Newsreader: Claws Mail 3.19.1 (GTK+ 2.24.33; x86_64-w64-mingw32) Bytes: 1623 On Sun, 9 Feb 2025 18:46:44 +0100 Janis Papanagnou wrote: > wrong! - assignment to 'a[99]' produced also no compiler complaints, gcc produces warning in this case, but only at optimization level of 2 or higher. clang does not warn at all, which is disappointing. OTOH, for non-VLA clang (and MSVC) warn at any optimization level. gcc behaves the same as with VLA, which is disappointing.