From owner-freebsd-current Sun Apr 23 22:51:15 2000 Delivered-To: freebsd-current@freebsd.org Received: from apollo.backplane.com (apollo.backplane.com [216.240.41.2]) by hub.freebsd.org (Postfix) with ESMTP id 3F9B037BAC6 for ; Sun, 23 Apr 2000 22:51:13 -0700 (PDT) (envelope-from dillon@apollo.backplane.com) Received: (from dillon@localhost) by apollo.backplane.com (8.9.3/8.9.1) id WAA66095; Sun, 23 Apr 2000 22:51:08 -0700 (PDT) (envelope-from dillon) Date: Sun, 23 Apr 2000 22:51:08 -0700 (PDT) From: Matthew Dillon Message-Id: <200004240551.WAA66095@apollo.backplane.com> To: Assar Westerlund Cc: Bruce Evans , attila , freebsd-current@FreeBSD.ORG Subject: Re: __func__ not declared for kernel build (5.0-CURRENT) References: <200004231730.KAA62311@apollo.backplane.com> <5lsnwcqqfj.fsf@assaris.sics.se> Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG : :Matthew Dillon 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 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message