Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6233063
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T10:13:52+00:00 2026-05-24T10:13:52+00:00

note: I am using g++ version 4.3.4 So I was learning about assert statements

  • 0

note: I am using g++ version 4.3.4

So I was learning about assert statements and came across a homebrew assert macro that uses that variables __LINE__ and __FILE__ which (cleverly) give the line number and the file name from where they were called — in this case, from where the assertation failed. These are epic pieces of information to have!

I was able to infer that the variable __FUNCTION__ will give you the function name that you are inside of… amazing!! However, when assert.h is at work, you also get the arguments to the function (i.e. function: int main(int, char**) and all I can do currently is get the function name…

Generally speaking, where can I learn more about these wonderful hidden variables and get a complete list of all of them?

p.s. I guess I understand now why you aren’t supposed to use variable names starting with __

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T10:13:53+00:00Added an answer on May 24, 2026 at 10:13 am

    As far as getting the function arguments, you can try using __PRETTY_FUNCTION__ instead of __FUNCTION__. More information is available here: http://gcc.gnu.org/onlinedocs/gcc/Function-Names.html

    As far as a list of pre-defined macros, you can find a lot of them if you hunt around in here: http://gcc.gnu.org/onlinedocs/cpp/Predefined-Macros.html#Predefined-Macros

    I cannot say with certainty that the list referenced above is complete. The reason I say this is that __PRETTY_FUNCTION__ cannot be found under the list of predefined macros… why this is, I cannot say.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I found the following claim in the documentation for Net::OpenSSH : Note that using
Note: I am using g++ version 4.3.4 to compile my C++ code. So far,
I am facing some odd problems while learning SQLAlchemy. I am using 0.7.2 version
NOTE: Using .NET 2.0, and VS2005 as IDE Hello all, I'm working on logging
Note: Using MySQL 4.0, which means no subqueries (at present). I have 2 tables:
Note: Using raw Win32 CreateTheard() API No MFC An interface is simply a pointer
Note: Using Monotouch. I have a directory called Images where I have all my
Note: I'm using Windows file servers and .NET If I were to create a
Note: I'm using Google Chrome Currently I have this test page http://www.evecakes.com/doodles/canvas_size_issue.htm It should
[NOTE: I'm using ASP.NET MVC2 RC2.] I have URLs like this: /customers/123/orders/456/items/index /customers/123/orders/456/items/789/edit My

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.