From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29130 invoked by alias); 21 Nov 2008 08:50:34 -0000 Received: (qmail 20584 invoked by uid 48); 21 Nov 2008 08:49:12 -0000 Date: Fri, 21 Nov 2008 08:50:00 -0000 Subject: [Bug libstdc++/38210] New: num_put<>::do_put(void*) performs padding incorrectly when adjustfield==internal X-Bugzilla-Reason: CC Message-ID: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "tsyvarev at ispras dot ru" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2008-11/txt/msg01767.txt.bz2 The following num_put<> member function iter_type do_put(iter_type out, ios_base& str, char_type fill, const void* val) const incorrectly performs padding of a string to bring its length to the required value if 'adjustfield' flag is equal to 'internal': instead of adding fill characters after "0x" it adds them at the beginning of the string According to the description of padding options (22.2.2.2.2 p19), if adjustfield == internal and representation after stage 1 began with 0x or 0X - pad after x or X. Example: #include #include using namespace std; int main() { void *p = (void*)0x1; cout.width(5); cout << internal << p << endl; return 0; } output " 0x1" while it should be "0x 1" -- Summary: num_put<>::do_put(void*) performs padding incorrectly when adjustfield==internal Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: libstdc++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: tsyvarev at ispras dot ru http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38210