-
Notifications
You must be signed in to change notification settings - Fork 273
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
__PRETTY_FUNCTION__ definition issue #423
Comments
https://gcc.gnu.org/onlinedocs/gcc/Function-Names.html
I don't see this as an issue with g3log . This seems to be to be a system setup issue on your company's side. g3log is public domain, so one option is to fork the repo and remove the troublesome code - if you can't align the GCC configurations across your systems. |
I think there may be some misunderstanding. So what I am trying to convey is that it is part of gcc, but is not defined as a macro. It's a magic literal. It doesn't get defined until compile time after the preprocessor AFAIK. You can't test it with defined(), I believe. So what's happening with g3log is that it is always overriding the built-in PRETTY_FUNCTION literal as far as I can tell. Here is an example that shows it not being defined but printing the result: You can click edit and recompile it if you want. Here's a stack overflow post that confirms my thoughts: |
Look at that. "Magic Constants" -- and I considered myself a (at one time at least) C++ expert. You learn something new everyday. It seems that the idef check is just nonsense in this case. Since we really want the Please put up a PR so we can evaluate. Nice find! |
The check for PRETTY_FUNCTION at least on gcc returns false in the g3log/g3log.hpp:33:
#if !(defined(__PRETTY_FUNCTION__))
For instance, I tested the following code:
Which compiles and runs fine. I assume it's because the PRETTY_FUNCTION is a magic literal and not a macro?
This causes issues with other libraries that use the literal when including g3log.hpp because g3log.hpp overrides the magic literal.
The text was updated successfully, but these errors were encountered: