C++ Logo

std-discussion

Advanced search

Re: int8_t outputs char via <iostream>

From: Bo Persson <bo_at_[hidden]>
Date: Sat, 23 Dec 2023 12:04:13 +0100
On 2023-12-23 at 09:50, Yongwei Wu via Std-Discussion wrote:
> The code behaves as expected. There is really nothing to discuss about,
> as far as the standard is concerned.
>
>
> If you think the standard is flawed, I could concur. But 1) there are
> always trade-offs, where C compatibility and backward compatibility are
> concerned; 2) no one is proposing a change right now....
>

It has been this way for 30 years, so not really a surprise bug that
suddenly appeared. So changing it now would be an even bigger surprise.

It *is* odd that some I/O functions are overloaded for signed char and
unsigned char, but others are not. There is even a footnote in the
standard pointing out those that are not. No motivation though.

Received on 2023-12-23 11:04:21