1.
Is there any reason / benefit to modifying a file scope variable (declared outside of any function, block, or class -- i.e. a global variable) with the static keyword? For example:
static const int a = 123; // file scope
rather than just:
const int a = 123; // file scope
It appears that the static keyword changes nothing. Is this correct?
2.
The following two bolded sentences appear to be contradictory:
http://msdn2.microsoft.com/en-us/library/xfx9kcae.aspx
"A name specified using the static keyword has internal linkage except for the static members of a class that have external linkage. That is, it is not visible outside the current translation unit."
http://msdn2.microsoft.com/en-us/library/s1sb61xd.aspx
"When modifying a variable or function at file scope, the static keyword specifies that the variable or function has internal linkage (its name is not visible from outside the file in which it is declared)."
Any thoughts to clear this up? Testing shows the first is correct. And I would guess it is correct based on the thought: Exactly how could a variable not be visible outside of its own file, if this file were included into another? Is the second statement incorrect, or does it have meaning that I am unaware of?
