egcs-2.93.08 19990215 sparc-sun-solaris2.5 bootstrap fails (genrecog)

Baron Roberts baron@peanut.engr.sgi.com
Thu Feb 18 21:02:00 GMT 1999


Ah the joys of multi-platform development. So as far as the wmem*
functions go, sure enough I did this fix on a Linux box. It appears
that the only place that uses wmem functions is straits.h:

  static int compare (const char_type* s1, const char_type* s2, size_t n)
    { return wmemcmp (s1, s2, n); }
  static char_type* copy (char_type* s1, const char_type* s2, size_t n)
    { return wmemcpy (s1, s2, n); }
  static char_type* set (char_type* s1, const char_type& c, size_t n)
    { return wmemset (s1, c, n); }

One naive suggestion is to try and replace the wmem functions with
calls to the appropriate wcs* functions:

  static int compare (const char_type* s1, const char_type* s2, size_t n)
    { return wcsncmp (s1, s2, n); }
  static char_type* copy (char_type* s1, const char_type* s2, size_t n)
    { return wcsncpy (s1, s2, n); }
  static char_type* set (char_type* s1, const char_type& c, size_t n)
    { while (n--) *s1 = c; return n; }

I know that these functions are available on Linux and IRIX. Someone
with a Sun should confirm the availability. Unfortunately, I could not
find an analog for wmemset so I just punted with the loop.

Baron

Zack Weinberg writes:
> On Thu, 18 Feb 1999 18:39:20 -0700, Jeffrey A Law wrote:
> >
> >  In message < 199902190112.UAA04415@blastula.phys.columbia.edu >you write:
> >  > It appears to work, now the build breaks in libstdc++:
> >[ ... ]
> >Yea.  Probably a result of this changes:
> >
> >1999-01-28  Baron Roberts  <baron@sgi.com>
> >
> >        * string: Uncomment wstring declaration.
> >
> >        * std/straits.h: Remove #if 0/#endif from around
> >        struct string_char_traits <wchar_t>.
> >        #include <cwchar>.
> >        Add missing definition for wchar_t move method.
> >        Add empty() method for trait-based empty string return.
> >
> >        * std/bastring.h (c_str): Change return of "" to return of
> >        traits::empty() call so that proper empty string is returned
> >        based on the character type (i.e. "" or L"").
> 
> This is going to be much harder to fix.  We want wide string support
> in libstdc++, but the wmem* functions are C9x and I haven't seen them
> anywhere except glibc.  I don't know from wide strings - anyone know a
> decent fallback?
> 
> zw
> 



____________________________________________________

Baron Roberts                   Phone (650) 933-1653
http://www.sgi.com              mailto:baron@sgi.com

Application Technology Group, Silicon Graphics Inc.
____________________________________________________


More information about the Gcc-bugs mailing list