Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Well, no, static just tells the compiler/linker that that function can only be used in the file that it is defined and written in.
Solar wrote:It keeps stunning me how friendly we - as a community - are towards people who start programming "their first OS" who don't even have a solid understanding of pointers, their compiler, or how a OS is structured.
Its a good idea to prevent clashes if you're puting the function inside of a header file. Otherwise each object file could export this function, leading to multiple definition errors when you link.
In some cases, forcing the inlining isn't a good idea, so make sure you are aware of the implications, e.g. when using virtual functions. (Read Scott Meyers' "Effective C++"?)
Every good solution is obvious once you've found it.
Simply declare the function 'inline' (and define it in the header file) and let the compiler decide whether to actually inline it or not. That's why 'inline' is merely a suggestion: The compiler knows more about the generated code than you do. (Usually.)
"Forcing" something is almost never a good idea.
Every good solution is obvious once you've found it.