In the wikibook x86 Disassembly
, it is written that sometimes there are subroutines that do not set up standard stack frames. One such case is when we declare a static function in C. The following lines have been written in the book.
When an optimizing compiler sees a static function that is only referenced by calls (no references through function pointers), it "knows" that external functions cannot possibly interface with the static function (the compiler controls all access to the function), so the compiler doesn't bother making it standard
.
I have following questions regarding the above statement :
Edit: Another question I would like the answer to: Why does the compiler in the above mentioned case set up non-standard stack frame instead of the standard one?
static
prevents other objects from finding it, but it doesn't prevent them from being handed it.