This is the mail archive of the libstdc++@sourceware.cygnus.com mailing list for the libstdc++ project.


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

More minor issues found while building libstdc++-v3 in gcc mainline for FreeBSD (with patch) 1/3


[In case you are wondering about the subject line, I sent another set
 of minor patches required for FreeBSD directly to Benjamin last week
 (he already installed them - thanks).]

For about the last week, I have needed this first patch or else I get
this warning (which is made fatal by -Werror):

../../../../egcs/libstdc++-v3/bits/char_traits.h: In function `_CharT *std::char_traits<_CharT>::assign
../../../../egcs/libstdc++-v3/bits/char_traits.h: (_CharT *, long unsigned int, _CharT) [with _CharT =
../../../../egcs/libstdc++-v3/bits/char_traits.h: __wchar_t]':
../../../../egcs/libstdc++-v3/bits/string.tcc:157:   instantiated from here
../../../../egcs/libstdc++-v3/bits/char_traits.h:117: warning: comparison between a signed and an
../../../../egcs/libstdc++-v3/bits/char_traits.h:117: warning: unsigned integer expressions

I offer no ChangeLog entry since I am suspect of any patch that
requires a new cast in code that used to be fine without it.  Maybe
someone that knows and understands what changed in the last week or so
that could affect that expression could comment on whether this cast
is now needed.  I am sorry that I didn't catch the exact change that
triggered this issue but I know we built fine without the cast right
after --enable-libstdcxx-v3 was added to gcc's configure program.

Index: libstdc++-v3/bits/char_traits.h
===================================================================
RCS file: /cvs/gcc/egcs/libstdc++-v3/bits/char_traits.h,v
retrieving revision 1.1
diff -p -r1.1 char_traits.h
*** char_traits.h       2000/04/21 20:33:28     1.1
--- char_traits.h       2000/04/25 04:38:18
*************** namespace std {
*** 114,120 ****
        static char_type* 
        assign(char_type* __s, int_type __n, char_type __a)
        { 
!       for (char_type* __p = __s; __p - __s < __n; ++__p) 
          assign(*__p, __a);
          return __s; 
        }
--- 114,120 ----
        static char_type* 
        assign(char_type* __s, int_type __n, char_type __a)
        { 
!       for (char_type* __p = __s; static_cast<int_type>(__p - __s) < __n; ++__p) 
          assign(*__p, __a);
          return __s; 
        }

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