AnsweredAssumed Answered

Multiple definitions of global variables in C

Question asked by Yaniv.Sapir on Mar 5, 2010
Latest reply on Mar 17, 2010 by CraigG

Hi,

 

I noticed that through #inclusion of multiple headers, some global variables were defined twice (but not initiaized). Also, some macro #definitions were repeated as well (with the same values). Doesn't the compiler supposed to give at least a warning, if not raise an error for double definitions of global variables and macros? Trying with automatic variables, the compiler raises an error when double definitions are made.

 

Yaniv.

Outcomes