Would you like signs with those chars?
Would you like signs with those chars?
Posted Oct 26, 2022 6:04 UTC (Wed) by wtarreau (subscriber, #51152)Parent article: Would you like signs with those chars?
I was fortunate to get hit by this a few decades ago, when seeing that my old dirty code doing this:
char c;
while ((c = getchar()) != EOF) {
/* do something */
}
would turn to an infinite loop on PPC, because chars were unsigned there and would never match EOF(-1). Since then I've been insisting on building and running my code on various architectures, among which Arm, in part for unsigned chars.
The LWN site is currently under high scraper load, so comment display has been suppressed for anonymous users. If you are a human, you may read the comments by clicking the button below:
Note: you can avoid this step in the future by logging into your LWN account.
