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

Herb Lewis hlewis at
Thu Jul 19 14:30:29 MDT 2012

On 07/19/2012 11:13 AM, Richard Sharpe wrote:
> On Thu, Jul 19, 2012 at 10:17 AM, David Disseldorp <ddiss at> wrote:
>> On Thu, 19 Jul 2012 09:35:09 -0700
>> Richard Sharpe <realrichardsharpe at> 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.
I think it would be great if we could rely on

We should probably change dbghdrclass (the function that prints the
header) so the
if( state.settings.debug_prefix_timestamp ) {
clause also adds func to the output, otherwise when "debug prefix
timestamp" is
set you will not see the function name. We would also need to add an
else clause to
if( state.settings.timestamp_logs ||
state.settings.debug_prefix_timestamp) {
so the function name is printed when timestamps are not enabled.

More information about the samba-technical mailing list