This is the mail archive of the libstdc++@sourceware.cygnus.com 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]

hmm: codecvt problem



I had this:

	    result_type __r = _M_cvt->in(_M_state_cur, 
					 _M_file->_IO_read_base,
					 _M_file->_IO_read_base + _M_buf_size,
		                         _M_file->_IO_read_end, 
					 _M_in_beg, _M_in_beg + _M_buf_size, 
					 _M_in_end);   


and it was giving me ammount of grief when I compiled with the new egcs:

c++ -DHAVE_CONFIG_H -I. -I../../src.libstdc++/src -I.. -nostdinc++
-I../../src.libstdc++ -I../../src.libstdc++/stl -fno-implicit-templates -g
-D_GNU_SOURCE -fimplicit-templates -c -fPIC -DPIC
../../src.libstdc++/src/misc-inst.cc
../../src.libstdc++/bits/std_fstream.h: In method `int
basic_filebuf<char,char_traits<char> >::underflow()':
../../src.libstdc++/src/misc-inst.cc:200:   instantiated from here
../../src.libstdc++/bits/std_fstream.h:249: initializing non-const `const char
*&' with `char *' will use a temporary
../../src.libstdc++/bits/locfacets.h:592: in passing argument 4 of
`_Codecvt<char,char,mbstate_t>::in(mbstate_t &, const char *, const char *,
const char *&, char *, char *, char *&) const'
make: *** [misc-inst.lo] Error 1

so as a temporary hack, I added this:
	    result_type __r = _M_cvt->in(_M_state_cur, 
					 _M_file->_IO_read_base,
					 _M_file->_IO_read_base + _M_buf_size,
		        const_cast<const char_type *&>(_M_file->_IO_read_end), 
					 _M_in_beg, _M_in_beg + _M_buf_size, 
					 _M_in_end);   


which seems like quite the hack.. . what puzzles me is that the first code is
right out of the standard (27.8.1.4 Overridden virtual functions p 3)--what
gives?

-Benjamin



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