This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: extern question
- From: John Love-Jensen <eljay at adobe dot com>
- To: Trevis Rothwell <tjr at gnu dot org>, MSX to GCC <gcc-help at gcc dot gnu dot org>
- Date: Tue, 06 Jun 2006 08:59:59 -0500
- Subject: Re: extern question
Hi Trevis,
> should I even be allowed to declare "larry" in both foo.c and
> bar.c ? If so, why is that not seen as a problem?
You can declare larry as many times as you want. You've declared it in
main.c and in bar.c.
You can only define larry once. You've defined it in bar.c.
If you change the declaration of larry in bar.c to a definition, then you've
defined it too many times (i.e., more than once).
HTH,
--Eljay