This is an archive of the discontinued LLVM Phabricator instance.

[NFC][Kaleidoscope] Modify a char type typo
AbandonedPublic

Authored by achieveartificialintelligence on Mar 20 2021, 8:11 AM.

Details

Reviewers
JDevlieghere
Summary

I'm a bit unsure, is this intentional or a typo?

Diff Detail

Event Timeline

achieveartificialintelligence requested review of this revision.Mar 20 2021, 8:11 AM
achieveartificialintelligence created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptMar 20 2021, 8:11 AM

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)

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!