(snip on calling conventions and their avanatages)
Not to my knowledge. Since an "internal" function is easy to detect at
compile time (declared static and never has its address taken within the
translation unit in which it's defined), it's probably not worthwhile to
make it a language feature.
Well, the main advantage (feature) and also disadvantage of internal
functions is access to variables from the host. I suppose having
file scope makes that not quite as necessary as it otherwise
would be.
The place I always miss it most is in calling a generic routine,
such as qsort, which then calls another routine. There is no
convenient way to pass other parameters through.
The problem occurs more in the case of integration, minimization,
or differential equation solving routines, such as are more often
written in Fortran. Other parameters were passed through COMMON,
as that was the only way to get them through.
There isn't so much need to pass values through to qsort(), but at
least one time I wanted to do that. You can use file scope variables
as long as you don't need to be reentrant.
It occurs to me that inlining is a (rather drastic) modification of
the calling convention. The set of functions that can be inlined is
probably about the same as the set of functions that can be called
with a non-standard (and perhaps more efficient) calling convention.
Seems to me that one advantage of inlining is that you might not
have to save all the registers (that would normally be saved).
On processors with many registers, that should be an advantage,
but on register starved systems, like IA32, and for not too
simple functions, it might be better to just save them.
In the case of an internal function, it would be a little more
obvious to the compiler that it has the choice between saving
or not.
Well, partly it goes back to the old tradeoff between time and
space. Inlining takes more space, but should be faster.
Even more, consider an internal function that is only called once.
You don't need to inline, just branch to where it is, and branch
back! (No return address to save.)
Oh well.
-- glen