Article View: comp.std.c
Article #93Re: int foo[]; vs. extern int foo[];
From: John F. Woods
Date: Thu, 06 Aug 1992 16:46
Date: Thu, 06 Aug 1992 16:46
13 lines
1219 bytes
1219 bytes
bill@twwells.com (T. William Wells) writes:
>: but I think the clarification
>: under "Semantics" in 3.5.7 ("If an object that has static storage duration
>: is not initialized explicitly, it is initialized implicitly as if every
>: member that has arithmetic type were assigned 0 and every member that has
>: pointer type were assigned a null pointer constant.") adequately blesses
>: the necessary interpretation.
>Unfortunately not. 3.7.2 implies that the behavior is as if there
>was an explicit declaration and so this section does not apply.
Since 3.7.2 contains no explicit C code, I think you have to be careful about
what you're literal about. "0" is not an initializer for an array, period.
"{0}" *is* an initializer for an array, whose value is zero (for each element).
Technical Details
Message-ID:
<14545@ksr.com>Path:
arc1-ca.pugleaf.net!sparky!uunet!cs.utexas.edu!zaphod.mps.ohio-state.edu!sol.ctr.columbia.edu!eff!world!ksr!jfwReferences:
<Bs938o.54A@twwells.com> <14383@ksr.com> <BsIFLn.6IH@twwells.com>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!cs.utexas.edu!zaphod.mps.ohio-state.edu!sol.ctr.columbia.edu!eff!world!ksr!jfw From: jfw@ksr.com (John F. Woods) Newsgroups: comp.std.c Subject: Re: int foo[]; vs. extern int foo[]; Message-ID: <14545@ksr.com> Date: 6 Aug 92 12:46:08 EDT References: <Bs938o.54A@twwells.com> <14383@ksr.com> <BsIFLn.6IH@twwells.com> Sender: news@ksr.com Lines: 13