I\'ve come across some code that has a large static function in a header file and i\'m just curious when it is/is not ok to do this. For example, if many .c fil
Modern C has adopted the inline keyword from C++ for such a task. But if your compiler doesn't have that (yet?) static in header files is a way to emulate that. inline doesn't mean that the function is necessarily inlined to any caller but just that there will be usually at most one copy in the final executable. (Technically the corresponding linker symbols are "weak" symbols.) In contrast, if just declared static every compilation unit will keep a copy.
Such an approach of having function definitions in headers should be restricted to small functions that do small tasks for which your compiler may improve the code substantially if it is optimized into the calling function.
When doing so, be also careful with the implementation of these functions. You may break your possibility to include declarations into C++ by that. Generally the two languages only agree (mostly) on interfaces, not necessarily for the implementation, there are subtle differences.