Do any of the compilers we care about not support __func__ or __FUNCTION__?

Christian Ambach ambi at samba.org
Thu Jul 19 15:19:46 MDT 2012


On 07/19/2012 08:13 PM, Richard Sharpe wrote:

>>> I am sick of seeing things like:
>>>
>>>                                  DEBUG(5,("read_fd_with_timeout: "
>>>                                          "blocking read. EOF from client.\n"));
>>>                                  return NT_STATUS_END_OF_FILE;
>>>
>>> where the name of the calling function has been laboriously typed in
>>> ... and there have been cases where code has been moved around and the
>>> function name not corrected.
>>
>> I totally agree. It's redundant information with the __func__ prefix
>> added by DEBUG, and is often incorrect.
>
> Actually, David, thanks for explaining what I was really complaining about.
>
> Yeah, since DEBUG puts the __func__prefix in the log, we don't need to
> repeat the function name. It just clutters things up.
>

Maybe we should then streamline the logging to stderr to also include
__func__, as that one only prints out the blank message and not the
function name.
When looking at outputs of e.g. smbstatus -d 5 or smbclient -d 10 -L
//localhost you'll see lots of lines that you cannot tell where those
are coming from. Some lines have the manually added function name that
helps finding that particular message in the source. So those have their
use until the output gets changed.

Cheers,
Christian




More information about the samba-technical mailing list