added getchar and getchar_unlocked which are just wrappers getc and getc_unlocked respectively.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
In our codebase we try to avoid calling entrypoints from other entrypoints. In this case that means not calling getc from getchar, instead mostly copying the code. This may seem silly, but it allows users to include any entrypoint on its own without having to worry about dependencies.
Other than that, this patch looks good, I'll approve it once that change is made.
after this is reviewed, can someone please commit this? (I dont have commit access yet)
libc/spec/posix.td | ||
---|---|---|
1083 | Is this the correct way to define a function that takes no arguments? |
libc/config/linux/x86_64/entrypoints.txt | ||
---|---|---|
426 | Can this also be enabled for ARM targets? |
Add to aarch64 entrypoints.txt, fix function spec
I didn't add to arm (32) entrypoints since the stdio.h isn't part of headers.txt yet
libc/src/stdio/getchar.cpp | ||
---|---|---|
25 | Nit: This can be if (result.value != 1). Same in getchar_unlocked. |
Can this also be enabled for ARM targets?