Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c > #7323

Use of EXTERN

From Tom Young <tyoung37@gmail.invalid>
Newsgroups comp.lang.c
Subject Use of EXTERN
Date 2011-06-30 20:38 +0000
Organization Aioe.org NNTP Server
Message-ID <iuimrb$9c$1@speranza.aioe.org> (permalink)

Show all headers | View raw


Hi all.  I've read through all the K&R2 chapters and I'm now reading the 
appendices.
Specifically, I'm reading section A11 - Scope & Linkage p227.  I have a
question about the "extern" property.

Section A11.2 Linkage p228 says:

"All declarations for the same object or function identifier with external
linkage refer to the same thing, and the object or function is shared by
the entire program."

and

"... the first external declaration for an identifier gives the identifier
internal linkage if the static specifier is used, external linkage
otherwise."

My questions are, is there any point to declaration an external object
"extern"?  Does it have any effect(s)?  I'm almost positive I've seen code
with external declarations that included the keyword "extern", but given
the quoted statements above, that seems redundant.  Am I missing
something?

Back to comp.lang.c | Previous | Next — Next in thread | Find similar | Unroll thread


Thread

Use of EXTERN Tom Young <tyoung37@gmail.invalid> - 2011-06-30 20:38 +0000
  Re: Use of EXTERN pete <pfiland@mindspring.com> - 2011-06-30 17:37 -0400
  Re: Use of EXTERN James Kuyper <jameskuyper@verizon.net> - 2011-07-01 07:11 -0400

csiph-web