GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||
GeezerVison is showing github.com — gh-121647: Prefer decltype() for _Py_TYPEOF() on C++ by vstinner · Pull Request #157267 · python/cpython Conversation
|
|
!buildbot AMD64 Windows11 Non-Debug 3.x PR |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
The regex 'AMD64 Windows11 Non-Debug 3.x PR' did not match any buildbot builder. Is the requested builder in the list of stable builders? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Right now, I don't access to a Windows machine to test my change, so I will rely on Windows buildbots for now. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
!buildbot AMD64 Windows11 Non-Debug 3.x |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
The regex 'AMD64 Windows11 Non-Debug 3.x' did not match any buildbot builder. Is the requested builder in the list of stable builders? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
!buildbot AMD64 Windows11 Non-Debug |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
🤖 New build scheduled with the buildbot fleet by @chris-eibl for commit 85a6ba9 🤖 Results will be shown at: https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F157267%2Fmerge The command will test the builders whose names match following regular expression: The builders matched are:
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Oh, test_cppext failed on "Ubuntu / build and test (ubuntu-26.04-arm)" CI: test.pythoninfo says |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Sadly, it still fails with the same error. I suppose that MSVC doesn't target C++11 by default. Even
By the way, test_limited_cpp03ext logs a compiler warning:
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Without /Zc:__cplusplus MSVC always sets
Maybe we can use the _MSVC_LANG preprocessor macro, because many people do not use
Yupp, that's not a valid option per https://learn.microsoft.com/en-us/cpp/build/reference/std-specify-language-standard-version?view=msvc-170. It "starts" with
But again, without |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
!buildbot AMD64 Windows11 Non-Debug PR |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
🤖 New build scheduled with the buildbot fleet by @vstinner for commit 13de0a0 🤖 Results will be shown at: https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F157267%2Fmerge The command will test the builders whose names match following regular expression: The builders matched are:
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Ok, let me retry with _MSVC_LANG macro :-) |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Replace "_Py_TYPEOF(dst)*" with "_Py_TYPEOF(&(dst))". In C++, "_Py_TYPEOF(dst)*" can fail with a compiler error.
|
For the Ubuntu failure, I can reproduce it locally on Fedora 44 (GCC 16.2.1) with the C program: It fails to build with: The fix is to replace |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Since _MSVC_LANG is always set when locally. Given that MSVC doesn't support anything older than @unittest.skipIf(support.MS_WINDOWS, "MSVC doesn't support /std:c++11") def test_build_cpp11(self): |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
!buildbot AMD64 Windows11 Non-Debug PR |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
🤖 New build scheduled with the buildbot fleet by @chris-eibl for commit ae56459 🤖 Results will be shown at: https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F157267%2Fmerge The command will test the builders whose names match following regular expression: The builders matched are:
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
I pushed a change for that. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Ah good, test_cppext passed on "Ubuntu / build and test (ubuntu-26.04-arm)" CI. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Aha, test_cppext also passed on the Windows buildbot. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
!buildbot Windows |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
🤖 New build scheduled with the buildbot fleet by @vstinner for commit dec5373 🤖 Results will be shown at: https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F157267%2Fmerge The command will test the builders whose names match following regular expression: The builders matched are:
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Using MSVC (on Windows), _Py_TYPEOF() prefers decltype() over __typeof__() on C++. Fix also _Py_TYPEOF() usage in Py_CLEAR() and Py_SETREF() macros. Replace "_Py_TYPEOF(dst)*" with "_Py_TYPEOF(&(dst))". In C++, "_Py_TYPEOF(dst)*" can fail with a compiler error.
Using MSVC (on Windows), _Py_TYPEOF() prefers decltype() over __typeof__() on C++. Fix also _Py_TYPEOF() usage in Py_CLEAR() and Py_SETREF() macros. Replace "_Py_TYPEOF(dst)*" with "_Py_TYPEOF(&(dst))". In C++, "_Py_TYPEOF(dst)*" can fail with a compiler error.
|
hello @vstinner @chris-eibl, I'm afraid I have bisected a new |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
This seems like a false positive, you're testing with Python 3.15 which does not have this commit? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Quoting #157649
So yeah, reproducible and legit on the main branch ... |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Let's continue the discussion in issue #157649. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
* gh-121647: Fix _Py_TYPEOF() on C++ (#157267) Using MSVC (on Windows), _Py_TYPEOF() prefers decltype() over __typeof__() on C++. Fix also _Py_TYPEOF() usage in Py_CLEAR() and Py_SETREF() macros. Replace "_Py_TYPEOF(dst)*" with "_Py_TYPEOF(&(dst))". In C++, "_Py_TYPEOF(dst)*" can fail with a compiler error. (cherry picked from commit bba99f2) * gh-157649: Fix Py_CLEAR()/Py_SETREF() on C++ (#158070) On C++, do not use decltype() in _Py_TYPEOF since it produces invalid code in Py_CLEAR() and Py_SETREF(). Instead, implement Py_CLEAR(), Py_SETREF() and Py_XSETREF() using "auto" on C++11 and newer. Add Py_CLEAR(), Py_SETREF() and Py_XSETREF() tests on an array. (cherry picked from commit 3330712)
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.