Liste des Groupes | Revenir à col misc |
The Natural Philosopher <tnp@invalid.invalid> writes:My complier writing friend suggested that if the function were declared static, and the function only called once. it certainly could be inlined, but he was not sure at what optimisation level of gcc it would be.And in fact these days with inline functionsModern compilers will often inline functions that aren’t declared
>
if(x>y)
fubar(x,y,z);
else
rabuf (z,y,x);
>
Is even shorter and allows the program flow rather than the
implementation to be seen clearly.
>
I wonder if compilers actually inline functions that are only called
once.
inline, yes; I don’t know if “only called once” is a consideration. It’s
not implausible (possibly in a more general form, e.g. “will inlining
all calls take more or less space overall?”)
Les messages affichés proviennent d'usenet.