- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Log4cplus, the library I maintain, uses __builtin_LINE(), __builtin_FUNCTION(), __builtin_FILE() builtins ([1]) when they are available. The availability is detected by version check against GCC 4.8 and later. The Intel C++ compiler version 15.0.1 claims GCC version 4.9.0 compatibilty, yet the builtins are not recognized. Are these hidden behind some switch that I do not notice or are they actually not implemented?
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Vaclav,
I have checked it in our problem tracking system, and I can confirm this is in fact not implemented. You may still use the old macros instead of builtins for Intel compiler.
Thanks,
Shenghong
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
shenghong-geng (Intel) wrote:
You may still use the old macros instead of builtins for Intel compiler.
Those are not equivalent. It is not immediately visible from the linked documentation but the builtins are not just equivalent of __FUNCTION__, etc. They return their respective values from the point of view of their caller. This allows me to do interesting things, like using them as default function parameter values:
class TraceLogger { public: TraceLogger(Logger l, log4cplus::tstring _msg, const char* _file = __builtin_FILE(), int _line = __builtin_LINE(), char const * _function = __builtin_FUNCTION()) { //... } //... };
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Vaclav,
Thank you for the clarification. Hope it will be implemented in future release, I'll add you as the affected customer of this issue in our problem tracking system.
Thanks,
Shenghong

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page