Richard wrote:
"James Kuyper Jr." <ja*********@ve rizon.netwrites :
>ar******@gmail. com wrote:
>>Any comments? thanks.
The keyword 'static' has many meanings in C, none of which make sense
inside a struct. C++ gave that keyword an additional meaning, which
applies only in that context, but this newsgroup is for discussing C,
not C++.
It would make perfect sense to see static in a struct as far as I can
see. What is so nonsensical about it? Or is your point not that it
wouldn't make sense, but that it's simply not available?
The standard defines (at least) three different meanings for the keyword
static, depending upon whether it's at file scope, block scope, or
function prototype scope. A single struct type, once defined, could be
used to declare an object in any of those scopes, so the possible
meaning of the 'static' keyword when applied to a member would have to
change with the scope.
File scope: what would it mean for a structure object to have external
linkage, but a member of that object to have internal linkage (or vice
versa)?
Block scope: What would it mean for a structure object to be
automatically or dynamically allocated, and to have a member that was
statically allocated (or vice versa)?
Function prototype scope: the only meaning currently provided for static
in this scope is that it requires that the leading dimension of an array
passed as a specific argument to the function to be at least as long as
the length specified for the corresponding parameter. I don't see how
that could be applied to struct members.
I'm not saying that answers couldn't be invented for these questions;
I'm merely saying that any answer would be a new invention, not a simple
extension to the currently defined meanings of 'static'.