Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 23 Apr 2000 22:51:08 -0700 (PDT)
From:      Matthew Dillon <dillon@apollo.backplane.com>
To:        Assar Westerlund <assar@sics.se>
Cc:        Bruce Evans <bde@zeta.org.au>, attila <attila@hun.org>, freebsd-current@FreeBSD.ORG
Subject:   Re: __func__ not declared for kernel build (5.0-CURRENT)
Message-ID:  <200004240551.WAA66095@apollo.backplane.com>
References:  <Pine.BSF.4.21.0004232323020.2928-100000@alphplex.bde.org> <200004231730.KAA62311@apollo.backplane.com> <5lsnwcqqfj.fsf@assaris.sics.se>

next in thread | previous in thread | raw e-mail | index | archive | help

:
:Matthew Dillon <dillon@apollo.backplane.com> writes:
:>     obviously missing __FUNCTION__ was added by GCC many years ago, but it was
:>     a while before it's use in defines in header (.h) files was dealt with
:>     properly.
:
:You mean outside a function?  What's the proper way of dealing with that?
:
:>     I wish these stupid standards committees would just choose
:>     something that people are already using rather then make up new names!
:
:The problem is that __func__ and __FUNCTION__ are not the same thing.
:And thus it makes sense for them not the use same name.
:
:/assar

    __FUNCTION__ represents the name of the C procedure you are currently
    in, same as __func__ as far as I can tell.

    You can define macros that use __FUNCTION__ in header files and then
    use them in the C code.  This works just fine, as of around 6 years
    ago (before then __FUNCTION__ in gnu C did not properly resolve when
    used in a macro in a header file).

    I use __FUNCTION__ all the time to implement ASSERT() macros.

					-Matt
					Matthew Dillon 
					<dillon@backplane.com>


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200004240551.WAA66095>