[PATCH] Correctly output internal-adjusted hexadecimals

Paolo Carlini pcarlini@unitus.it
Fri Nov 23 03:31:00 GMT 2001


Benjamin Kosnik wrote:

> Hey, nice job. This is in.

Good!
However, Benjamin, I think there is a very subtle issue lurking in the PR. The
original testcase has:

        oss << "0xTrap!";

notice the double commas!
As I understand the standard this is *not* a number but a string, so
libstdc++-v3 should process it as a string not as an hex, and output the *whole*
0xTrap! block right aligned with padding before, i.e, what internal alignment
boils down for strings.
On the other hand, __pad, which is unified for num_put and ostream, sees only
strings, and deals with the various cases only on the basis of the first chars
of the string passed as a parameter. It has *no way* to make a distintion.

Of course, if the testcase is something like (i.e. my testcase for the
testsuite):

    oss << 0x43535;

then, after this last check in ;-) everything is ok.

What do you think?

Cheers,
Paolo.




More information about the Libstdc++ mailing list