[preprocessor] vc++ using the experimental preprocessor
I have updated on the 'develop' branch Boost PP code that will use the vc++ C++ standard conforming preprocessor in VS2017 15.8 and above, as explained at https://blogs.msdn.microsoft.com/vcblog/2018/07/06/msvc-preprocessor-progres.... The code essentially treats vc++ in this mode as a strictly standard conforming preprocessor. There is the switch of /experimental:preprocessor which turns on the new preprocessor for the end-user, else the normal non-standard vc++ preprocessor is still the current default. BTW I tried to post a comment to the link above, explaining that the test posted in the article for the new preprocessor was wrong, but for whatever reason it never was actually posted as a comment. Nonetheless I got it right for myself in the Boost PP code in its config.hpp, so I am not going to worry about the fact that others may use the erroneous test in the article in their code. The change I made to Boost PP does not affect any other compiler, including vc++ in normal non-standard preprocessor mode. I have no idea if any regression tests for msvc-14.1 are made with this /experimental:preprocessor switch, but I will wait for 'develop' to cycle through before merging to 'master' in Boost PP. My preprocessor tests show four failures with the new vc++ preprocessor. Two of the failures are based on the fact that the test code expects a macro called with the wrong number of arguments to produce a compiler error and not just a warning. But since I have been told, vis-a-vis the same situation occurring for the Oracle C ++ compiler, that compilers are allowed under the C++ standard to produce a warning and just "chug" on, even if producing macro output that is certainly not what the programmer intended, rather than produce a compilation error maybe I just need to eliminate those tests, as important as I think they are. The other two failures are with the BOOST_PP_ITERATE macro and corresponding structures. The new preprocessor also erroneously continues to give a number of argument mismatch warnings in cases where it does not really exist, similar to the non-standard preprocessor, but since it "chugs" on despite the false warnings it ends up producing the correct output anyway. I have already posted a bug report about the fact that the new preprocessor gives a warning and continues when a macro is called with the wrong number of arguments. The other problem with BOOST_PP_ITERATE will be harder to determine because the iterate mechanism in Boost PP is fairly complex and I will need to figure out what is causing it and reduce the failure to a much simpler form in order to report it. As far as the compiler warnings of the wrong number of arguments when they do not exist, again I will have to try and figure out why and report the bug(s) to Microsoft. If anyone wants to try this out on Boost PP 'develop' feel free to do so. You will need to invoke the msvc-14.1 toolset in Boost Build with the /experimental:preprocessor switch and you will need to upgrade VS2017 to 15.8 or above. You can tell whether you have succeeded invoking the Boost PP tests with the new preprocessor by looking at the run output of the config_info test. If the BOOST_PP_CONFIG_FLAGS() is 0x0001 it is the new preprocessor, else it is the default non-standard preprocessor (0x0004).
On 21/10/2018 05:44, Edward Diener via Boost wrote:
If anyone wants to try this out on Boost PP 'develop' feel free to do so. You will need to invoke the msvc-14.1 toolset in Boost Build with the /experimental:preprocessor switch and you will need to upgrade VS2017 to 15.8 or above. You can tell whether you have succeeded invoking the Boost PP tests with the new preprocessor by looking at the run output of the config_info test. If the BOOST_PP_CONFIG_FLAGS() is 0x0001 it is the new preprocessor, else it is the default non-standard preprocessor (0x0004).
What's your general opinion of the quality of the new MSVC preprocessor? Niall
On 10/22/2018 4:32 AM, Niall Douglas via Boost wrote:
On 21/10/2018 05:44, Edward Diener via Boost wrote:
If anyone wants to try this out on Boost PP 'develop' feel free to do so. You will need to invoke the msvc-14.1 toolset in Boost Build with the /experimental:preprocessor switch and you will need to upgrade VS2017 to 15.8 or above. You can tell whether you have succeeded invoking the Boost PP tests with the new preprocessor by looking at the run output of the config_info test. If the BOOST_PP_CONFIG_FLAGS() is 0x0001 it is the new preprocessor, else it is the default non-standard preprocessor (0x0004).
What's your general opinion of the quality of the new MSVC preprocessor?
It needs to be bug free when run against the Boost PP and Boost VMD tests, else it is not standard conforming as far as I can know. I have not tried it against the Boost VMD tests yet but I will. The fact that there are still some bugs when run against Boost PP means it still needs to be fixed further. Of course I am not claiming that Boost PP or Boost VMD tests actually test every possible situation in a C++ standard preprocessor, but they are pretty good in testing a great many of its macro expansion situations. Microsoft did triage my bug report about the wrong number of arguments to a macro giving a warning rather than a compiler error so that is encouraging. It would be real nice if Microsoft provided a means, as part of the new MSVC preprocessor, to show their own step-by-step output of any given macro's expansion as this would make it much easier to find and report the bugs in a much more simple example which are still occurring in the Boost PP testing. I can of course use Boost Wave, which is a great tool, but that shows how a given macro should expand according to the C++ standard and not how MSVC macro expansion is actually happening. OTOH, as part of a bug report, I can just point Microsoft to the Boost PP tests which are failing or producing incorrect warnings, but I doubt that is acceptable as a bug report on which they will act. Of course it is encouraging that after so many years of supporting a non-standard C++ preprocessor Microsoft is finally attempting to create a standard C++ preprocessor.
Niall
Edward Diener wrote:
OTOH, as part of a bug report, I can just point Microsoft to the Boost PP tests which are failing or producing incorrect warnings, but I doubt that is acceptable as a bug report on which they will act.
I think that it is. Boost is part of their in-house test suite.
On 10/22/2018 6:03 AM, Peter Dimov via Boost wrote:
Edward Diener wrote:
OTOH, as part of a bug report, I can just point Microsoft to the Boost PP tests which are failing or producing incorrect warnings, but I doubt that is acceptable as a bug report on which they will act.
I think that it is. Boost is part of their in-house test suite.
The update to use the new preprocessor is currently only in the Boost PP 'develop' branch, although I will merge to 'master' before 1.69 closes. Is testing directly from Boost source part of their in-house test suite ? Probably STL knows but I do not.
Edward Diener wrote:
The update to use the new preprocessor is currently only in the Boost PP 'develop' branch, although I will merge to 'master' before 1.69 closes. Is testing directly from Boost source part of their in-house test suite?
I think that they use a release. They're probably on 1.68 now, don't know their policy on upgrading it. I could be wrong though.
On 10/22/2018 5:11 PM, Peter Dimov via Boost wrote:
Edward Diener wrote:
The update to use the new preprocessor is currently only in the Boost PP 'develop' branch, although I will merge to 'master' before 1.69 closes. Is testing directly from Boost source part of their in-house test suite?
I think that they use a release. They're probably on 1.68 now, don't know their policy on upgrading it. I could be wrong though.
In that case telling them to run the tests on the 'develop' branch of Boost PP passing /experimental:preprocessor to the b2 command line, in order to verify a particular failure occurring from the result, is probably not going to be acceptable as a bug report. But I will try it.
On Mon, 22 Oct 2018 at 12:54, Edward Diener via Boost
Of course it is encouraging that after so many years of supporting a non-standard C++ preprocessor Microsoft is finally attempting to create a standard C++ preprocessor.
As **the** expert in this field [within the context of Boost], you are best placed to help them achieve that goal. STL is lurking this mailing list, but you **will** need to file bug-reports. As Peter said, pointing to the failing tests, should be good enough. degski -- *“If something cannot go on forever, it will stop" - Herbert Stein*
OTOH, as part of a bug report, I can just point Microsoft to the Boost PP tests which are failing or producing incorrect warnings, but I doubt that is acceptable as a bug report on which they will act.
Outcome has been part of MSVC's test suite for some months now, as is Boost. Outcome has broken MSVC in all sorts of subtle and interesting corner case ways. Microsoft have spotted the failure within 24 hours, triaged it, and self fixed the problem, usually providing an ETA of when the compiler fix will ship. So Edward if I were you, I'd make Boost.Preprocessor and Boost.VMD for the 1.69 release use standard preprocessor if you detect it is enabled in MSVC. That'll cause MSVC to fail in the Boost conformance testing. That in turn will ensure Microsoft triage and fix all outstanding problems in super quick time. That's my recommendation to you, anyway. Niall
On 10/22/2018 2:54 PM, Niall Douglas via Boost wrote:
OTOH, as part of a bug report, I can just point Microsoft to the Boost PP tests which are failing or producing incorrect warnings, but I doubt that is acceptable as a bug report on which they will act.
Outcome has been part of MSVC's test suite for some months now, as is Boost.
Outcome has broken MSVC in all sorts of subtle and interesting corner case ways. Microsoft have spotted the failure within 24 hours, triaged it, and self fixed the problem, usually providing an ETA of when the compiler fix will ship.
So Edward if I were you, I'd make Boost.Preprocessor and Boost.VMD for the 1.69 release use standard preprocessor if you detect it is enabled in MSVC. That'll cause MSVC to fail in the Boost conformance testing. That in turn will ensure Microsoft triage and fix all outstanding problems in super quick time.
That's my recommendation to you, anyway.
That is my intent. Boost VMD uses the configuration settings on Boost PP and I have already changed Boost PP on the 'develop' branch to detect the new vc++ preprocessor and use it when it is enabled. I will merge 'develop' to 'master' before 1.69 closes for changes, which I think is this coming Saturday. I just want to make sure the regression tests recycle before I do so.
Niall
On Mon, Oct 22, 2018 at 8:54 PM, Niall Douglas via Boost
OTOH, as part of a bug report, I can just point Microsoft to the Boost PP tests which are failing or producing incorrect warnings, but I doubt that is acceptable as a bug report on which they will act.
Outcome has been part of MSVC's test suite for some months now, as is Boost.
Outcome has broken MSVC in all sorts of subtle and interesting corner case ways. Microsoft have spotted the failure within 24 hours, triaged
Within 24h of what? Release? If so, how come they didn't spot and fix it before release? -- Olaf
Outcome has been part of MSVC's test suite for some months now, as is Boost.
Outcome has broken MSVC in all sorts of subtle and interesting corner case ways. Microsoft have spotted the failure within 24 hours, triaged
Within 24h of what? Release? If so, how come they didn't spot and fix it before release?
Microsoft track Outcome HEAD. Given the 24 hour lag from when I push a commit which fails on MSVC, I would assume they have it on a nightly cronjob. Personally speaking, I just love this arrangement. I no longer need to code around MSVC. I just push the code which won't compile, and Microsoft fix MSVC for me. Wonderful. Niall
On Mon, 22 Oct 2018 at 20:54, Niall Douglas via Boost
That'll cause MSVC to fail in the Boost conformance testing. That in turn will ensure Microsoft triage and fix all outstanding problems in super quick time.
That's my recommendation to you, anyway.
+1 degski -- *“If something cannot go on forever, it will stop" - Herbert Stein*
On 10/23/2018 3:22 AM, degski via Boost wrote:
On Mon, 22 Oct 2018 at 20:54, Niall Douglas via Boost
wrote: That'll cause MSVC to fail in the Boost conformance testing. That in turn will ensure Microsoft triage and fix all outstanding problems in super quick time.
That's my recommendation to you, anyway.
+1
degski
+1 --Robert
participants (6)
-
degski
-
Edward Diener
-
Niall Douglas
-
Olaf van der Spek
-
Peter Dimov
-
Robert