-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[libc][stdbit][c23] fixes typos in bit_width, bit_floor C type-generic macros #84659
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
Conversation
Thank you for submitting a Pull Request (PR) to the LLVM Project! This PR will be automatically labeled and the relevant teams will be If you wish to, you can add reviewers by using the "Reviewers" section on this page. If this is not working for you, it is probably because you do not have write If you have received no comments on your PR for a week, you can request a review If you have further questions, they may be answered by the LLVM GitHub User Guide. You can also ask questions in a comment on this PR, on the LLVM Discord or on the forums. |
@llvm/pr-subscribers-libc Author: Michael Flanders (Flandini) ChangesFixes #84658. Assuming these were typos in the first place. I am unsure of the best way to ensure that both sides of the preprocessor condition in Full diff: https://github.com/llvm/llvm-project/pull/84659.diff 1 Files Affected:
diff --git a/libc/include/llvm-libc-macros/stdbit-macros.h b/libc/include/llvm-libc-macros/stdbit-macros.h
index 5b51068f866b71..e3eb6630afddb6 100644
--- a/libc/include/llvm-libc-macros/stdbit-macros.h
+++ b/libc/include/llvm-libc-macros/stdbit-macros.h
@@ -274,14 +274,14 @@ inline unsigned long long stdc_bit_floor(unsigned long long x) {
unsigned long long: stdc_has_single_bit_ull)(x)
#define stdc_bit_width(x) \
_Generic((x), \
- unsigned char: stdc_bit_width_ui, \
+ unsigned char: stdc_bit_width_uc, \
unsigned short: stdc_bit_width_us, \
unsigned: stdc_bit_width_ui, \
unsigned long: stdc_bit_width_ul, \
unsigned long long: stdc_bit_width_ull)(x)
#define stdc_bit_floor(x) \
_Generic((x), \
- unsigned char: stdc_bit_floor_ui, \
+ unsigned char: stdc_bit_floor_uc, \
unsigned short: stdc_bit_floor_us, \
unsigned: stdc_bit_floor_ui, \
unsigned long: stdc_bit_floor_ul, \
|
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.
Thanks for fixing this!
@Flandini Congratulations on having your first Pull Request (PR) merged into the LLVM Project! Your changes will be combined with recent changes from other authors, then tested Please check whether problems have been caused by your change specifically, as How to do this, and the rest of the post-merge process, is covered in detail here. If your change does cause a problem, it may be reverted, or you can revert it yourself. If you don't get any reports, no action is required from you. Your changes are working as expected, well done! |
Thanks for the patch! So in order to support I'm not sure if gtest can be used to test code in C mode, but these macros all need to get rewritten anyways. |
Fixes #84658.
Assuming these were typos in the first place.
I am unsure of the best way to ensure that both sides of the preprocessor condition in
libc/include/llvm-libc-macros/stdbit-macros.h
are tested. Could someone point me in the right direction for adding test coverage to the non__cplusplus
branch? Or maybe it is being tested and I've missed it.