Mail Archives: djgpp/1997/05/28/07:35:43
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 -