0

After using callgrind to profile my code, I see that __printf_fp() is the function with more value in the self column. What is this function and when is it called?

Thank you!

Javi
  • 3,440
  • 5
  • 29
  • 43
  • Any identifier including two consecutive underscores is reserved for the compiler & standard library, so it's probably an internal routine of your standard library. Look for details there. But judging from the name, it's probably a subroutine of `printf`. – Angew is no longer proud of SO Feb 14 '14 at 11:35
  • I deleted the post since I got the answer by checking the calls graph. It is used by ofstream in my case which I forgot I was using in my code. I undeleted the post since your answer could be useful for anybody. Thank you! – Javi Feb 14 '14 at 11:41
  • I don't think my comment is enough for a full answer, but you can self-answer your question (there's a certain timeout since posting after which that's possible), and incorporate what parts of it you consider relevant. – Angew is no longer proud of SO Feb 14 '14 at 11:44
  • Why the downvotes? I thought it was more honest to edit the post instead of posting a self-reply, which makes not too much sense for me. – Javi Feb 14 '14 at 12:18
  • 1
    This is first and foremost a Q&A site - editing answers into questions is discouraged, while self-answers are actually rather encouraged. And I think that while not too broad, the question (with an answer) can still be useful. (Note: I didn't downvote you, of course). – Angew is no longer proud of SO Feb 14 '14 at 12:22
  • Ok I will add the answer when I can because of the time restriction. Thank you once again :) – Javi Feb 14 '14 at 12:25

1 Answers1

1

__printf_pf() belongs to the libstdc++ library. It is mainly called by any printf related function (ostream, ofstream, etc). However, when it is called depends on the compiler and compiler's version as pointed out here: C++ output stream floating point call chain

Community
  • 1
  • 1
Javi
  • 3,440
  • 5
  • 29
  • 43