fwknop icon indicating copy to clipboard operation
fwknop copied to clipboard

Use of the __func__ identifier

Open fjoncourt opened this issue 12 years ago • 1 comments

I was wondering if it would be a good idea to use the func identifier to display the name of the function when a warning is logged for example.

log("my first function(): here is the error description")

could be replaced by :

log("%s(): here is the error description", __func__)

But I am not sure about portability. Any thoughts ?

fjoncourt avatar May 14 '13 20:05 fjoncourt

I think portability may pose an issue with the func identifier. My opinion is that it would need to be gated by an autoconf check (assuming this is possible and reliable) and corresponding #define wrappers.

mrash avatar May 15 '13 03:05 mrash