public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/13598] New: enc_filebuf doesn't work
@ 2004-01-07 11:13 peturr02 at ru dot is
  2004-01-07 11:14 ` [Bug libstdc++/13598] " peturr02 at ru dot is
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: peturr02 at ru dot is @ 2004-01-07 11:13 UTC (permalink / raw)
  To: gcc-bugs

Although enc_filebuf now compiles (PR 13189), it's not possible to do any
actual IO with it.

The problem seems to be that basic_filebuf assumes that state_type is
assignable, but __enc_traits isn't. Although operator= is defined for
__enc_traits, t = u doesn't result in t being equivalent to u, since
it doesn't copy the iconv_t members (_M_*_desc):

    // Need assignment operator as well.
    __enc_traits&
    operator=(const __enc_traits& __obj)
    {
      strncpy(_M_int_enc, __obj._M_int_enc, _S_max_size);
      strncpy(_M_ext_enc, __obj._M_ext_enc, _S_max_size);
      _M_in_desc = 0;
      _M_out_desc = 0;
      _M_ext_bom = __obj._M_ext_bom;
      _M_int_bom = __obj._M_int_bom;
      return *this;
    }

(Note that there is a memory leak here if _M_in_desc or _M_out_desc are
non-null.)

-- 
           Summary: enc_filebuf doesn't work
           Product: gcc
           Version: 3.4.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: libstdc++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: peturr02 at ru dot is
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13598


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

end of thread, other threads:[~2004-05-24 21:25 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-01-07 11:13 [Bug libstdc++/13598] New: enc_filebuf doesn't work peturr02 at ru dot is
2004-01-07 11:14 ` [Bug libstdc++/13598] " peturr02 at ru dot is
2004-01-07 11:18 ` pinskia at gcc dot gnu dot org
2004-01-16 16:08 ` paolo at gcc dot gnu dot org
2004-01-16 17:24 ` paolo at gcc dot gnu dot org
2004-03-26 15:25 ` bkoz at gcc dot gnu dot org
2004-05-25 17:05 ` bkoz at gcc dot gnu dot org

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).