public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "peturr02 at ru dot is" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug libstdc++/13598] New: enc_filebuf doesn't work
Date: Wed, 07 Jan 2004 11:13:00 -0000	[thread overview]
Message-ID: <20040107111314.13598.peturr02@ru.is> (raw)

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


             reply	other threads:[~2004-01-07 11:13 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-01-07 11:13 peturr02 at ru dot is [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20040107111314.13598.peturr02@ru.is \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).