-
Notifications
You must be signed in to change notification settings - Fork 12.5k
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
who implements C23 <stdbit.h> and <stdckdint.h>? #62248
Comments
I think CC @jyknight @zygoloid @efriedma-quic @rjmccall for further opinions |
@llvm/issue-subscribers-c2x |
did you mean that, or did you mean the opposite? <stdckdint.h> is macro-only, whereas <stdbit.h> says "It is unspecified whether any generic function declared in <stdbit.h> is a macro or an identifier declared with external linkage". tbh, i think these are only useful as macros, because the whole point is that they're all just builtins that hopefully resolve to a single instruction. which is why it seems like maybe the compilers (who own the builtins) should own the headers too? (i'm happy to contribute headers --- i'm interested in reducing duplication, not specifically about getting out of doing work myself :-) ) |
stdbit.h can't really be implemented as just a header because it's legal to take the address of some of the functions. (I mean, maybe you could do something tricky to make the implementations linkonce, but I don't think we want to.) |
(other C vendors) @DimitryAndric @richfelker |
doesn't the part of the standard i quoted above explicitly give us the latitude to not have them be real functions? "It is unspecified whether any generic function declared in <stdbit.h> is a macro or an identifier declared with external linkage." |
Oh, you're right,
Agreed, I think we have that latitude here. |
The standard says it's "unspecified whether any generic function declared in <stdbit.h> [...]". Note the word "generic"; I'm pretty sure the rule is only supposed to apply to the type-generic functions, and the non-generic functions follow the ordinary rules for standard library functions. |
Oh shoot, you're right Eli (sorry for waffling). The allowances in 7.1.4 don't save us (they're what obligate us to make the non-generic APIs be real functions at the end of the day). |
The consensus, IIUC, is that clang will provide |
I agree, that's the consensus here. And thank you to @ZijunZhaoCCK for looking into adding |
#62248 Reviewed By: yabinc, aaron.ballman, #clang-language-wg Differential Revision: https://reviews.llvm.org/D157331
Are these like
<stdnoreturn.h>
, or like<stdio.h>
? I don't care, but it would be silly for me to add them to bionic if Clang will just provide its own anyway :-)(the Clang
<tgmath.h>
in particular makes me think this might be one you'd rather do yourselves?)The text was updated successfully, but these errors were encountered: