BTW, you need to give the float
array a name.
If you compile the shown source as a C file an empty object file will be the result. No symbol will be stored.
If you use the shown source as a header file included in another C file which does not call tensor_trace()
, the object file will have no symbol stored for it.
If you use the shown source as a header file included in another C file which does call tensor_trace()
, the object file will have a symbol stored for it. At the place where the call is generated a reference to this symbol is placed. The linker will resolve this reference to the function which will have to be defined in another module.
So to answer your question:
Is "tensor_trace" allocated somwhere?
The machine code for tensor_trace()
will be "allocated" in the module that defines it. The declaration does not allocate any space.