Article View: comp.std.c
Article #6244Re: Simple questions about array declarations
From: Karl Heuer
Date: Tue, 27 Feb 1990 21:36
Date: Tue, 27 Feb 1990 21:36
16 lines
1273 bytes
1273 bytes
In article <12235@smoke.BRL.MIL> gwyn@brl.arpa (Doug Gwyn) writes:
>- static int array7[]; static int array7[3] = { 1,2,3 };
>- static int array8[3]; static int array8[3] = { 1,2,3 };
>- static int array9[3]; static int array9[] = { 1,2,3 };
>- static int array10[]; static int array10[] = { 1,2,3 };
>
>All these are okay.
That's what I thought, too, but when Ron said (in email) that gcc didn't like
them all, I checked the ANS. 3.7.2 says "if the declaration... is a tentative
definition and has internal linkage, the declared type shall not be an
incomplete type". This seems to make array7 and array10 illegal.
It's also a pretty stupid rule, in my opinion.
Karl W. Z. Heuer (karl@ima.isc.com or harvard!ima!karl), The Walking Lint
Technical Details
Message-ID:
<16045@haddock.ima.isc.com>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!tut.cis.ohio-state.edu!snorkelwacker!spdcc!ima!haddock!karlReferences:
<25E833AA.15362@paris.ics.uci.edu> <12235@smoke.BRL.MIL>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!tut.cis.ohio-state.edu!snorkelwacker!spdcc!ima!haddock!karl From: karl@haddock.ima.isc.com (Karl Heuer) Newsgroups: comp.std.c Subject: Re: Simple questions about array declarations Message-ID: <16045@haddock.ima.isc.com> Date: 27 Feb 90 21:36:23 GMT References: <25E833AA.15362@paris.ics.uci.edu> <12235@smoke.BRL.MIL> Reply-To: karl@haddock.ima.isc.com (Karl Heuer) Organization: Interactive Systems, Cambridge, MA 02138-5302 Lines: 16