The response states that Open Watcom compiles such code
bool f(bool var1) { bool var2 = !var1; return var2; } bool g(bool var1) { bool var2; if (var1) var2 = 0; else var2 = 1; return var2; } in the following way
bool near f( bool ): L$1: test al,al sete al ret bool near g( bool ): jmp L$1 That is, from the function g , jmp is made to the beginning of the function f.
It turns out that the function g has an extra jmp compared to f .
Why is this needed and why it was impossible to simply combine the function
gitself withf?bool near f( bool ): bool near g( bool ): test al,al sete al retWhat does the standard say on this subject? For example, is there a clause that pointers to two different functions must be different? If so, what does he give?
- What are the advantages of such an implementation?