return "" in bastring.h ?

Harri Porten porten@tu-harburg.de
Tue Mar 14 14:27:00 GMT 2000


Hi !

It's probably a known problem that the following code in std/bastring.h
gives quite some problems when using different charT's than char.

  const charT* c_str () const
    { if (length () == 0) return ""; terminate (); return data (); }

I checked that CVS logs and saw that it was fixed temporarily in
revision 1.15 but reverted again in 1.16 with the following comment:

  revision 1.16
  date: 1999/02/20 12:21:51;  author: law;  state: Exp;  lines: +1 -2
          * string, std/straits.h, std/bastring.h: Revert recent
change.  Needs
          some libiberty support before it can be re-enabled.

Is there any final fix in sight ?

I'm currently hindered from replacing my home-grown Unicode string class
by STL due to this bug. Is there any way to work around it ? Any magic
conversion operator ?

Thanks,

Harri.


More information about the Gcc-bugs mailing list