Path: csiph.com!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Keith Thompson Newsgroups: comp.lang.c Subject: Re: Preprocessor Overheads Date: Thu, 02 Feb 2017 10:19:08 -0800 Organization: None to speak of Lines: 25 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: mx02.eternal-september.org; posting-host="523b5027be519a02b651eac1ee0346e8"; logging-data="28089"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+quo5rlCbjh5XqCGLmeVx9" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:0HW62YdDQoJkDyHaeA/W7AYQmGI= sha1:bZtef+sMwguGR4M8yCuY9AQNXaU= Xref: csiph.com comp.lang.c:102969 BartC writes: > On 02/02/2017 09:30, David Brown wrote: [...] >> zero-length arrays are not valid in C, so don't try to make them. You >> can't declare an array of one length (zero or anything else) and then >> "set it up" later with a different size. > > Yes you can. First declare this: > > int array[] = {}; The empty initializer is invalid (it's actually a syntax error, see the syntax in 6.7.9), and any conforming compiler must at least warn about it. Some compilers may support it as an extension. You're free to depend on that extension if you choose to do so, but you should be clear (to yourself and to the rest of us) that you're doing something outside standard C. [...] -- 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"