delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/05/28/07:35:43

From: Robert Hoehne <Robert DOT Hoehne AT Mathematik DOT tu-chemnitz DOT de>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: djgpp bug
Date: Wed, 28 May 1997 13:03:33 +0200
Organization: TU Chemnitz-Zwickau
Message-ID: <338C1105.6097C25A@Mathematik.tu-chemnitz.de>
References: <Pine DOT SUN DOT 3 DOT 96 DOT 970528105752 DOT 17268A-100000 AT dia DOT csd DOT uch DOT gr>
NNTP-Posting-Host: pandora.hrz.tu-chemnitz.de
Mime-Version: 1.0
Lines: 19
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

KOMODakis Nikolaos wrote:
> 
> If you declare the same global (not static) variable in two different C
> files, the compiler doesn't tell you anything (not even a warning).
> However, it allocates the same space for the two definitions.

When gcc compiles one source file, it does nothing now about anything
in any other source file.
But when you link (NOTE link and not compile) these two files
to an executable, then you will get an error. 

Robert
-- 
*****************************************************************
* Robert Hoehne, Fakultaet fuer Mathematik, TU-Chemnitz-Zwickau *
* Post:    Am Berg 3, D-09573 Dittmannsdorf                     *
* e-Mail:  Robert DOT Hoehne AT Mathematik DOT TU-Chemnitz DOT DE              *
* WWW:     http://www.tu-chemnitz.de/~rho                       *
*****************************************************************

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019