Repository navigation
gh-148695: Lint warnings in cases generator, ceval with GIL, and optimizer. #148696
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
base: main
Are you sure you want to change the base?
Changes from all commits
0bcbef2
1a9e5fa
97af7be
9a8a094
00bce84
b4e54dd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| Lint warnings in cases generator, ceval with GIL, and optimizer. | ||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -224,9 +224,13 @@ def __init__(self, check_stack_bounds: bool = False) -> None: | |
| self.variables: list[Local] = [] | ||
| self.check_stack_bounds = check_stack_bounds | ||
|
|
||
| def push_cache(self, cached_items:list[str], out: CWriter) -> None: | ||
| def push_cache(self, op_name: str, cached_items:list[str], outputs: int, out: CWriter) -> None: | ||
| for i, name in enumerate(cached_items): | ||
| out.start_line() | ||
| if (op_name == "_CALL_TYPE_1" and outputs == 2) \ | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this is too fragile. Can't we just have a maybe unused attribute instead? and what about clang attributes? (AFAICT this is a GCC attribute only). I do not think the unused variable warnings need to be suppressed.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can the
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think so. But again is there a need to suppress such warnings? we provide no guarantee for -Wall -Werror/-Wpedantic and I do not see value in suppressing unused variable warninga in general. |
||
| or (op_name == "_SHUFFLE_3_LOAD_CONST_INLINE_BORROW" and outputs == 3) \ | ||
| or (op_name == "_RROT_3" and outputs == 3): | ||
| out.emit("Py_GCC_ATTRIBUTE((unused))\n") | ||
| out.emit(f"_PyStackRef _stack_item_{i} = {name};\n") | ||
| self.push(Local.register(f"_stack_item_{i}")) | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not think this needs a NEWS entry (or if so, it should be clearer because this sentence does not explain much)