public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* libstdc++/9874: filebuf::seekpos fails if codecvt::encoding() <= 0
@ 2003-02-27 10:26 peturr02
  0 siblings, 0 replies; 3+ messages in thread
From: peturr02 @ 2003-02-27 10:26 UTC (permalink / raw)
  To: gcc-gnats


>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 <fstream>
#include <locale>

#undef NDEBUG
#include <cassert>

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;
}


^ permalink raw reply	[flat|nested] 3+ messages in thread

* RE: libstdc++/9874: filebuf::seekpos fails if codecvt::encoding() <= 0
@ 2003-03-02 18:46 Pétur Runólfsson
  0 siblings, 0 replies; 3+ messages in thread
From: Pétur Runólfsson @ 2003-03-02 18:46 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

The following reply was made to PR libstdc++/9874; it has been noted by GNATS.

From: =?iso-8859-1?Q?P=E9tur_Run=F3lfsson?= <peturr02@ru.is>
To: <paolo@gcc.gnu.org>,
	<gcc-bugs@gcc.gnu.org>,
	<nobody@gcc.gnu.org>,
	=?iso-8859-1?Q?P=E9tur_Run=F3lfsson?= <peturr02@ru.is>,
	<gcc-gnats@gcc.gnu.org>
Cc:  
Subject: RE: libstdc++/9874: filebuf::seekpos fails if codecvt::encoding() <= 0
Date: Sun, 2 Mar 2003 18:40:10 -0000

 >     Confirmed. Support for state dependent/variable length
 >     encodings is not really implemented presently in the library.
 
 I agree that state-dependent isn't supported, but at least for
 UTF-8, it is possible to do almost everything except seek, read
 from files bigger than BUFSIZ bytes, and read from wcin (and
 I've posted a patch that fixes that).
 
 Petur
 
 


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: libstdc++/9874: filebuf::seekpos fails if codecvt::encoding() <= 0
@ 2003-03-02 16:59 paolo
  0 siblings, 0 replies; 3+ messages in thread
From: paolo @ 2003-03-02 16:59 UTC (permalink / raw)
  To: gcc-bugs, gcc-prs, nobody, peturr02

Synopsis: filebuf::seekpos fails if codecvt::encoding() <= 0

State-Changed-From-To: open->analyzed
State-Changed-By: paolo
State-Changed-When: Sun Mar  2 16:59:23 2003
State-Changed-Why:
    Confirmed. Support for state dependent/variable length
    encodings is not really implemented presently in the library.

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=9874


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2003-03-02 18:46 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-02-27 10:26 libstdc++/9874: filebuf::seekpos fails if codecvt::encoding() <= 0 peturr02
2003-03-02 16:59 paolo
2003-03-02 18:46 Pétur Runólfsson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).