Declaring a static function does not really prevent it from being called from other translation units.
What static means is that it prevents the transfer of a function (related) from other translation units by name. This will exclude the possibility of direct calls to this function, that is, it will call "by name". To do this, the compiler simply excludes the function name from the table of external names exported from the translation unit. In addition, there is nothing special about static functions.
You can still call this function from other translation units in other ways. For example, if you somehow got a pointer to a static function in another translation unit, you can call it through this pointer.
AnT
source share