[PATCH] D99017: [NFC][Kaleidoscope] Modify a char type typo
Shao-Ce Sun via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Mar 23 23:46:31 PDT 2021
achieveartificialintelligence added a comment.
In D99017#2642740 <https://reviews.llvm.org/D99017#2642740>, @dblaikie wrote:
> Yeah, the code is correct as-is, changing it to char would be incorrect.
>
> `getchar` returns int ( https://linux.die.net/man/3/getchar ) and needs to so it can return EOF, which isn't a char value (otherwise there'd be no way to distinguish between that char value correctly being read from the file, and the case where it indicates the end of the file)
Thank you for your advice!
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D99017/new/
https://reviews.llvm.org/D99017
More information about the llvm-commits
mailing list