I have inherited a large C++ project in which a multithreaded executable loads a few dozen DLLs. On Windows, the DLLs are loaded using LoadLibrary(), and the entry points to the DLLs are accessed using GetProcAddress().
One of the entry points in each DLL is a function called MyEntryPoint, declared like this on Windows:
extern "C" __declspec(dllexport) void MyEntryPoint()
MyEntryPoint() needs to call helper functions inside the DLL where it is defined. The helper functions do not need to be exported outside of the DLL in which they are declared because they are used only locally. However, several DLLs have functions with the same name. Example: in several DLLs, there is a function declared as:
void MyHelperFunction()
which is called by MyEntryPoint(). In some DLLs, MyHelperFunction() is declared static, but not in others. (Over the years, there have been many hands in the code, with varying levels of understanding and expertise.) Does declaring MyHelperFunction() as static avoid cluttering the global namespace, or is there another reason for doing it?