From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12588 invoked by alias); 27 Feb 2003 10:26:01 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 12561 invoked by uid 71); 27 Feb 2003 10:26:01 -0000 Resent-Date: 27 Feb 2003 10:26:01 -0000 Resent-Message-ID: <20030227102601.12559.qmail@sources.redhat.com> Resent-From: gcc-gnats@gcc.gnu.org (GNATS Filer) Resent-Cc: gcc-prs@gcc.gnu.org, gcc-bugs@gcc.gnu.org Resent-Reply-To: gcc-gnats@gcc.gnu.org, peturr02@ru.is Received: (qmail 12035 invoked by uid 48); 27 Feb 2003 10:21:32 -0000 Message-Id: <20030227102132.12034.qmail@sources.redhat.com> Date: Thu, 27 Feb 2003 10:26:00 -0000 From: peturr02@ru.is Reply-To: peturr02@ru.is To: gcc-gnats@gcc.gnu.org X-Send-Pr-Version: gnatsweb-2.9.3 (1.1.1.1.2.31) Subject: libstdc++/9874: filebuf::seekpos fails if codecvt::encoding() <= 0 X-SW-Source: 2003-02/txt/msg01409.txt.bz2 List-Id: >Number: 9874 >Category: libstdc++ >Synopsis: filebuf::seekpos fails if codecvt::encoding() <= 0 >Confidential: no >Severity: serious >Priority: medium >Responsible: unassigned >State: open >Class: sw-bug >Submitter-Id: net >Arrival-Date: Thu Feb 27 10:26:01 UTC 2003 >Closed-Date: >Last-Modified: >Originator: peturr02@ru.is >Release: gcc-3.2.1 >Organization: >Environment: Red Hat Linux 8.0 >Description: basic_filebuf<>::seekpos currently calls basic_filebuf<>::seekoff, which makes seekpos useless for variable-width encodings (where codecvt<>::encoding() <= 0). >How-To-Repeat: See attachment. >Fix: >Release-Note: >Audit-Trail: >Unformatted: ----gnatsweb-attachment---- Content-Type: text/plain; name="seekposbug.cc" Content-Disposition: inline; filename="seekposbug.cc" #include #include #undef NDEBUG #include int main() { using namespace std; wfilebuf fb; fb.pubimbue(locale("is_IS.UTF-8")); fb.open("setposbug.cc", ios_base::in); fb.sbumpc(); streampos p1 = fb.pubseekoff(0, ios_base::cur); fb.sbumpc(); streampos p2 = fb.pubseekpos(p1); assert(p2 != streampos(-1)); fb.close(); return 0; }