Skip to content

[support][nfc] MD5: Undef macros after use #132132

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

Merged
merged 1 commit into from
Mar 21, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions llvm/lib/Support/MD5.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -296,3 +296,11 @@ MD5::MD5Result MD5::hash(ArrayRef<uint8_t> Data) {

return Res;
}

#undef F
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder if it would be reasonable to upgrade these macros to constexpr functions instead.

Copy link
Member

Choose a reason for hiding this comment

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

+1, but I don't think this is a blocker

Copy link
Contributor Author

@Hardcode84 Hardcode84 Mar 21, 2025

Choose a reason for hiding this comment

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

Searching them on github gives a lot of hits, so they were probably copypasted from some common place: https://github.com/search?q=%23define+F%28x%2C+y%2C+z%29+%28%28z%29+%5E+%28%28x%29+%26+%28%28y%29+%5E+%28z%29%29%29%29&type=code

#undef G
#undef H
#undef I
#undef STEP
#undef SET
#undef GET