GCC has some built-in macros like __FILE__ and similar to print debugging info using printf statements. I have used this sometimes to print information, though I do nothave examples available right now. Have a look at the GCC documentation. I don't think this is portable among compilers.
Linux