kearns@read.columbia.edu (Steve Kearns) (12/20/89)
This is a question for all you "link" gurus out there. In using Glock C++ 1.2e1 ( a port of at&t c++ 1.2e1 to the pc) and examining the C file it generates, I have noticed the following: If a class, described in a file class.h, has a static memeber, say "int linkcount", then the generated C file will have a declaration "int linkcount". However, EVERY c++ file that includes class.h will generate a c file with this declaration. Thus when linking the linker may notice that "linkcount" has been declared multiple times. But that is not even the scary part. What if an inline function modifies the linkcount. Will different files use different instances of "linkcount"? This could really mess things up, since programmers assume that all accesses of a static member access the same variable. -steve