[ale] C++ Debuggery and the Path of Destruction

Barry Rountree rountree at cs.uga.edu
Sat Sep 25 16:32:54 EDT 2004


On Saturday 25 September 2004 02:20 pm, John Mills wrote:

> Aha - I supposed I would be entering explicit text to replace
> __FILE__::__LINE__ - Are these predefined symbols that [say] cpp fills in
> during compilation? That's very nice to know.

__LINE__ is a builtin macro that expands to a decimal constant.
__FILE__ is another that expands into a string.  

There are also goodies like __DATE__ and __TIME__.  Google Predefined 
Preprocessors Macros for a list.

I'm pretty sure MSVC++ has both __CLASS__ and __FUNCTION__.  All the gnu 
compilers have __FUNCTION__ and __PRETTY-FUNCTION__ (which gives class info).

And yes, I found out most of this after I had larded up thirty files with

#undef CLASSNAME
#define CLASSNAME ("YetAnotherClass")
#undef FUNCNAME
#define FUNCNAME ("YetOneMoreFunction")

Getting to remove all of those was a red-letter day.

Barry



>
>  - John Mills
>    john.m.mills at alum.mit.edu
>
> _______________________________________________
> Ale mailing list
> Ale at ale.org
> http://www.ale.org/mailman/listinfo/ale



More information about the Ale mailing list