This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


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

2 bugs in gcc-2.95.2


Hi,

Here are a couple of bug reports:

1.--------------------
egcs-1.1.2 and gcc-2.95.2 both appear to have this bug:

Near line 301 of bastring.h we have this:

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

However, when I use basic_string<wchar_t>::c_str(), gcc complains
because "" is not a wide string (charT* is wchar_t* in this case).

Removing the entire if-statement fixes the problem.

2.-----------------------
gcc-2.95.2 on Solaris 7 miscompiles conditional expressions
involving literal wide strings; egcs-1.1.2 on RH6.2 does not have
this problem and works ok.

For example, the expression: (b ? L"a" : L"b") always yields L"a"
regardless of the value of 'b'.

Ram

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