Let’s say I only want to expose a function from one of my files by passing out a function pointer to that function. Is it safe to declare that function as static
? Are compilers allowed to do any judo that would invalidate my function pointer, or make it meaningless outside the context of that file, since the function is declared as specific to that file?
Not my code, but a (silly) example of what I mean:
void static cool_function(void);
void extern (*cool_function_ptr)(void); // Actually, I’m not sure of where the `extern` goes in a function-
// pointer declaration. Damn you, confusing function-pointer syntax!
Given that code (or the syntactically correct approximation thereof), would it be illegal to access cool_function_ptr
from another file?