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

Christopher R. Hertel crh at
Thu Jul 19 13:56:00 MDT 2012

I think a quick review of the use of __FUNCTION__ (a GCC extension) vs.
__func__ (C99 standard) would be in order.  I just did a quick grep, and it
looks as though we jump through some hoops to make sure one or the other
exists, but then use both different bits of code.

It probably all works...

Chris -)-----

On 07/19/2012 12:40 PM, Jeremy Allison wrote:
> On Thu, Jul 19, 2012 at 09:35:09AM -0700, Richard Sharpe wrote:
>> Hi folks,
>> 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.
>> Are there compilers we care about that do not support __func__ or
>> equivalent? I would think not because we depend on something like that
>> and __line__ in the DEBUG macros.
> I am the worst offender here. If we can truly depend on __func__
> or __line__ then I'll go on parole and promise to stop doing it
> again :-).
> Jeremy.

"Implementing CIFS - the Common Internet FileSystem" ISBN: 013047116X
Samba Team --     -)-----   Christopher R. Hertel
jCIFS Team --   -)-----   ubiqx development, uninq.
ubiqx Team --     -)-----   crh at
OnLineBook --    -)-----   crh at

More information about the samba-technical mailing list