Skip to content

gh-124044: protect macros expansions using do-while constructions (WIP) #123842

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

Closed
wants to merge 26 commits into from

Conversation

picnixz
Copy link
Member

@picnixz picnixz commented Sep 8, 2024

Opening for the CI.

I'm just making a large PR and then I'll cherry-pick commits to create branches instead of having hundreds of different branches...


Note for myself:

  • #define (\w+)\(.*\)\s*\\\s*\{
  • #\s+define (\w+)\(.*\)\s*\\\s*\{
  • #define (\w+)\(.*\)\s*\s*\{.*\\
  • #\s+define (\w+)\(.*\)\s*\s*\{.*\\
  • #define (\w+)\(.*\)\s*\\\s* (current module: _dbmodule.c)
  • #\s+define (\w+)\(.*\)\s*\\\s*

Modifications on compile.c is a separate PR. Headers files are untouched since they can be included by third-party libraries.

@picnixz picnixz changed the title Chore/do while expansions (WIP) protect macros expansions using do-while constructions Sep 8, 2024
@picnixz

This comment was marked as resolved.

@picnixz
Copy link
Member Author

picnixz commented Sep 8, 2024

For reviewers: test failures on JIT/aarch64-unknown-linux are known #123681.

@picnixz picnixz force-pushed the chore/do-while-expansions branch from f52268c to 555ca98 Compare September 9, 2024 11:32
@picnixz picnixz force-pushed the chore/do-while-expansions branch from 555ca98 to 44474eb Compare September 9, 2024 11:36
@picnixz picnixz force-pushed the chore/do-while-expansions branch from 0ee7eb4 to 7f1eb83 Compare September 9, 2024 12:13
@picnixz picnixz force-pushed the chore/do-while-expansions branch from 7f1eb83 to 5c90db8 Compare September 9, 2024 12:40
@picnixz picnixz changed the title (WIP) protect macros expansions using do-while constructions gh-124044: protect macros expansions using do-while constructions (WIP) Sep 13, 2024
Copy link
Member

@vstinner vstinner left a comment

Choose a reason for hiding this comment

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

I'm not convinced that this change fix any actual bug. It's more a "coding style"-only change and we usually don't accept them. It's ok to have some coding style changes while fixing a bug, but not have a pull request just for that. Also, this change modifies many files (29) which can lead to conflict in other open pull requests (we have 1700 open pull requests) and downstream patches in Linux distributions.

@picnixz
Copy link
Member Author

picnixz commented Jan 23, 2025

I don't think it's worth keeping this branch opened, considering that fixing those kind of things is just for cosmetic alignments. Almost all the macros are used correctly (namely, we don't have dangling elses), so we should only change them if needs arise. Surprisingly, I only have one file that has conflicts....

@picnixz picnixz closed this Jan 23, 2025
@picnixz picnixz deleted the chore/do-while-expansions branch January 23, 2025 14:22
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