[Bug libstdc++/37475] codecvt::do_in/do_out functions return "ok" when the output sequence has zero length

redi at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed Jun 12 20:35:51 GMT 2024


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=37475

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
           Assignee|unassigned at gcc dot gnu.org      |redi at gcc dot gnu.org
                URL|                            |https://gcc.gnu.org/piperma
                   |                            |il/gcc-patches/2024-June/65
                   |                            |4410.html
           Keywords|                            |patch

--- Comment #13 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Full patch: https://gcc.gnu.org/pipermail/gcc-patches/2024-June/654410.html

(In reply to Kristian Spangsege from comment #12)
> These changes look good to me.
> 
> A couple of points:
> * Should the `else`s still be there now that the preceding branches
> terminate with `break`?

Doesn't really matter either way.

> * `do_out()` has the same problem as `do_in()`.

Yes, addressed in the posted patch.

> * If there is already testing of `codecvt`, should a test be added for the
> "empty output" case?

Yes, addressed in the posted patch.

> * This could break code that expects the incorrect behavior.

That's true for every bug fix. We should conform to the standard though.


More information about the Gcc-bugs mailing list