This is the mail archive of the mailing list for the GCC 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]

libstdc++/9874: filebuf::seekpos fails if codecvt::encoding() <= 0

>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
>Originator:     peturr02 at ru dot is
>Release:        gcc-3.2.1
Red Hat Linux 8.0
basic_filebuf<>::seekpos currently calls basic_filebuf<>::seekoff, which makes seekpos useless for variable-width encodings (where codecvt<>::encoding() <= 0).
See attachment.

Content-Type: text/plain; name=""
Content-Disposition: inline; filename=""

#include <fstream>
#include <locale>

#undef NDEBUG
#include <cassert>

int main()
	using namespace std;

	wfilebuf fb;
	fb.pubimbue(locale("is_IS.UTF-8"));"", ios_base::in);
	streampos p1 = fb.pubseekoff(0, ios_base::cur);
	streampos p2 = fb.pubseekpos(p1);
	assert(p2 != streampos(-1));

	return 0;

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