gcc performs an optimization where it expects standard library functions to behave as specified in the standard in order to turn calls into the standard C library into more efficient machine code. For example, it is likely that gcc emits one fsqrt command for your sqrt() call, never calling your custom sqrt() at all.
You can disable this behavior by providing -fno-builtin to disable this optimization for all recognized functions, or by supplying -fno-builtin-function to disable this optimization only for function . For example, -fno-builtin-sqrt will honor gcc with your non-standard sqrt() .
source share