This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Correctly output internal-adjusted hexadecimals


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.



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]