Request for more info out of __FUNCTION__

Michael Meissner meissner@cygnus.com
Wed Feb 2 11:24:00 GMT 2000


On Wed, Feb 02, 2000 at 02:13:58PM -0600, Benjamin Scherrey wrote:
> I have a little debug macro that displays where in my code I happen to
> be. It uses the __FILE__, __LINE__, and __FUNCTION__ compile-time
> variables to show me where the code is executing. One thing I would
> find very useful is if the __FUNCTION__ variable would show methods as
> "class::function" instead of just "function" as the messages kinda get
> hard to differentiate when going through class hierarchies or
> templated methods. Is this something that could easily be changed?

For G++ use __PRETTY_FUNCTION__ instead of __FUNCTION__, it will emit a string
that has the return type and the argument types.

-- 
Michael Meissner, Red Hat, Inc.
PMB 198, 174 Littleton Road #3, Westford, Massachusetts 01886
Work:	  meissner@redhat.com		phone: 978-486-9304 fax: 978-692-4482
Non-work: meissner@spectacle-pond.org


More information about the Gcc mailing list