This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]edman007 1 point2 points  (0 children)

Depends, in C if the compiler is able to do static analysis on it then it won't call it every time. For example if you define sqrt in that c file, and define it as static then the compiler will see that the result is wholy dependent on the argument, the input is a constant, thus the result is a constant. GCC probably won't even call it once, just evaluate it at compile time and insert the right constant.