M
Michael Birkmose
Hi,
Using gcc the following is possible:
int some_function(struct local_struct { int member;} a);
This function takes one parameter "a" of the type struct local_struct.
This type is declared locally on the paramter list, and only has scope in
that function.
Gcc gives the following output:
warning: structure defined inside parms
warning: `struct local_struct' declared inside parameter list
warning: its scope is only this definition or declaration, which is probably not what you want.
My question is now - how would anyone invoke this function with such a
parameter? I mean it's hard to instantiate a variable of that type, since
it is not declared outside the function?
Using gcc the following is possible:
int some_function(struct local_struct { int member;} a);
This function takes one parameter "a" of the type struct local_struct.
This type is declared locally on the paramter list, and only has scope in
that function.
Gcc gives the following output:
warning: structure defined inside parms
warning: `struct local_struct' declared inside parameter list
warning: its scope is only this definition or declaration, which is probably not what you want.
My question is now - how would anyone invoke this function with such a
parameter? I mean it's hard to instantiate a variable of that type, since
it is not declared outside the function?