gh-125207: Fix MSVC 1935 build with JIT#125209
Merged
mdboom merged 4 commits intopython:mainfrom Oct 18, 2024
Merged
Conversation
Contributor
Author
|
@zooba: What do you think about this PR? Upgrading MSVC did resolve it, but IIUC the minimum required version of MSVC is 14.0, which would certainly require this change. |
zooba
reviewed
Oct 18, 2024
Member
zooba
left a comment
There was a problem hiding this comment.
The choice is either to make a trivial change to keep building, or to go through and declare (and detect and warn) that specific compilers are no longer permitted.
I suspect you'll prefer to just take this trivial change 😉
Tools/jit/_stencils.py
Outdated
| trampoline_mask.append(f"{word:#04x}") | ||
| bitmask >>= 32 | ||
| return "{" + ", ".join(trampoline_mask) + "}" | ||
| if len(trampoline_mask): |
Member
There was a problem hiding this comment.
Suggested change
| if len(trampoline_mask): | |
| if trampoline_mask: |
Or you could "{" + (", ".join(trampoline_mask) or "0") + "}".
Tools/jit/_writer.py
Outdated
| yield f"static const void * const symbols_map[{max(len(symbols), 1)}] = {{" | ||
| for symbol, ordinal in symbols.items(): | ||
| yield f" [{ordinal}] = &{symbol}," | ||
| if len(symbols): |
| @@ -32,8 +32,11 @@ def _dump_footer( | |||
| yield "};" | |||
| yield "" | |||
| yield f"static const void * const symbols_map[{max(len(symbols), 1)}] = {{" | |||
Member
There was a problem hiding this comment.
Looking at this, there shouldn't be a need for the length in here? And while I believe it's okay, it could be affected by this change.
pablogsal
pushed a commit
to pablogsal/cpython
that referenced
this pull request
Oct 18, 2024
* pythongh-125207: Use {0} array initializers * Simplify, as suggested in PR * Revert change to explicitly specify length Signed-off-by: Pablo Galindo <pablogsal@gmail.com>
pablogsal
pushed a commit
to pablogsal/cpython
that referenced
this pull request
Oct 21, 2024
* pythongh-125207: Use {0} array initializers * Simplify, as suggested in PR * Revert change to explicitly specify length Signed-off-by: Pablo Galindo <pablogsal@gmail.com>
pablogsal
pushed a commit
to pablogsal/cpython
that referenced
this pull request
Oct 21, 2024
* pythongh-125207: Use {0} array initializers * Simplify, as suggested in PR * Revert change to explicitly specify length Signed-off-by: Pablo Galindo <pablogsal@gmail.com>
ebonnal
pushed a commit
to ebonnal/cpython
that referenced
this pull request
Jan 12, 2025
* pythongh-125207: Use {0} array initializers * Simplify, as suggested in PR * Revert change to explicitly specify length
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Empty array initializers (
{}) are not strictly standards compliant, and at least MSVC 1935 doesn't support them. This fixes those initializers to be{0}.