-
Notifications
You must be signed in to change notification settings - Fork 75
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
MSVC: BOOST_PP_STRINGIZE __LINE__ #39
Comments
I am not seeing this in VS2019 with the latest Boost. What version of MSVC are you using and what version of Boost are you using ? My test program is:
and the output is 6 and not "__LINE__". |
Visual Studio 2022 community preview version 17.0.0 Preview 3. |
Can you try Visual Studio 2019 or Visual Studio 2019 Preview and see if you get the same results as with Visual Studio 2022 Preview ? I tried Visual Studio 2019 or Visual Studio 2019 Preview and I got the correct result. I really, really doubt that this is a Boost PP problem. Nothing in the BOOST_PP_STRINGIZE code has changed that would suggest a bug in Boost PP. If you can give me a command line with the compiler options you use it would be appreciated. I have downloaded Visual Studio 2022 Preview and will try it once I get it setup to use with Boost on my local machine. |
Here is where it used https://github.com/ohhmm/openmind/blob/703e42a40122f82ee7d8061fedd53b6740751e20/omnn/math/Valuable.h#L24 |
Did you try my simple example above and see if the result matches mine ? |
It was ok with 2019 |
Then it must be something with the new preview since it was also OK with the 2019 preview. If my simple example failed with 2022 preview and succeeds with VS2019, then you might want to report it as a bug to Microsoft. You can lift the code from the stringize.hpp header file in your report and massage it if you like, but it is really very simple. BOOST_PP_CONFIG_MSVC() in stringize.hpp is turned on for VC++ using the default preprocessor but is not set when the new preprocessor is being used. Either way, whether with the default preprocessor or the new preprocessor my tests showed that the correct result occurred with both VS2019 and VS2019 Preview. I would imagine that in the 2022 preview that the new preprocessor might now be the default but even in that case the code in stringize.hpp should work fine even if the code for the old, default preprocessor is being used, which I doubt is actually the case. |
I was able to setup VS2022 Preview and tried my code above with both the default preprocessor and the new preprocessor and the result was correctly "6" and not "__LINE__". |
I had this case: |
I changed the program I used to test, called test_stringize.cpp, to:
and in all cases the correct result of |
Sure, will do. |
I can not read your image. Please copy as code if you want me to read it. |
I am assuming the problem is in your code and not in this library. Can I close this issue ? |
See the LINE in the message. The workaround patch diff shown working well through third level of macro indirection is here ohhmm/openmind@2a84c9d |
I can not follow what you are trying to show me. You need to produce a simple code example which shows a problem with |
Hi Edward, It appears to be only reproduced inside the Visual Studio Test Console. Thanks & Regards |
Visual Studio Test Console is not a compiler. You have to reproduce the bug in a compiler. |
Ok, I'll capture its params |
Broken on MSVC:
BOOST_PP_STRINGIZE(__LINE__)
returns"__LINE__"
The text was updated successfully, but these errors were encountered: