Path: csiph.com!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder2.enfer-du-nord.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Wojtek Lerch Newsgroups: comp.std.c Subject: Re: When is the complete type of an external definition known? Date: Mon, 20 Aug 2012 10:57:11 -0400 Lines: 24 Message-ID: References: <653592d3-2e3d-4252-baae-cf1da6fb18e9@googlegroups.com> <4c03f493-4606-4893-a3b6-291bd03152ff@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Trace: individual.net RQLPDZnrWkfYGWyUo9OzCgy72lyor4dyyljU0NiynCez7VOqsSAPv8m7osczskhyqg Cancel-Lock: sha1:/CauNu4KADbjaKmensC/35/PWQM= User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:14.0) Gecko/20120713 Thunderbird/14.0 In-Reply-To: Xref: csiph.com comp.std.c:1566 On 19-Aug-12 10:22 PM, Keith Thompson wrote: > Vlad from Moscow writes: >> понедельник, 20 августа 2012 г., 1:56:49 UTC+4 пользователь Ike Naar написал: >>> On 2012-08-19, Vlad from Moscow wrote: > [...] >>> static int a[]; >>> >>> violates 6.9.2 p3: >>> >>> "If the declaration of an identifier for an object is a tentative >>> definition and has internal linkage, the declared type shall not be >>> an incomplete type." > > ... (more precisely a constraint violation). Actually that paragraph is in a Semantics section, not in a Constraints section. It's plain undefined behaviour without a promise of a diagnostic. Out of curiosity, does anybody know the reason for this restriction? It sounds like a useful thing to be able to do. (And I have to admit that did it more than once, before I knew about this.) Is it because different compilers used to interpret it differently back in the day, and the standard didn't want to break them? The Rationale doesn't seem to mention "tentative" at all.