Skip to content

gh-148695: Lint warnings in cases generator, ceval with GIL, and optimizer.#148696

Open
clin1234 wants to merge 4 commits intopython:mainfrom
clin1234:warning_lint
Open

gh-148695: Lint warnings in cases generator, ceval with GIL, and optimizer.#148696
clin1234 wants to merge 4 commits intopython:mainfrom
clin1234:warning_lint

Conversation

@clin1234
Copy link
Copy Markdown
Contributor

@clin1234 clin1234 commented Apr 17, 2026

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) \
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The 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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can the Py_UNUSED macro be applied to lvalue variables?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants