3.1 Patch: Improve libstdc++-v3 for mips-sgi-irix6.5
Jeffrey Oldham
oldham@codesourcery.com
Mon Jun 4 08:49:00 GMT 2001
This patch resolves three of the four unresolved libstdc++-v3 test
regressions for mips-sgi-irix6.5 by prepending "std::" in front of
select functions to resolve overloaded function difficulties.
2001-06-04 Jeffrey Oldham <oldham@codesourcery.com>
* include/bits/char_traits.h (move): Qualify memmove with std::.
(copy): Qualify memcpy with std::.
* testsuite/27_io/filebuf_virtuals.cc (test01): Qualify strlen and
strncmp with std::.
(test02): Likewise.
* testsuite/27_io/stringbuf_virtuals.cc (test01): Likewise.
Tested on i686-pc-linux-gnu and mips-sgi-irix6.5
Approved by Gabriel Dos Reis <gdr@codesourcery.com>
Committed to gcc 3.1
Thanks,
Jeffrey D. Oldham
oldham@codesourcery.com
Index: include/bits/char_traits.h
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/include/bits/char_traits.h,v
retrieving revision 1.6
diff -c -p -r1.6 char_traits.h
*** char_traits.h 2001/03/07 22:22:41 1.6
--- char_traits.h 2001/06/01 02:13:57
*************** namespace std
*** 93,103 ****
static char_type*
move(char_type* __s1, const char_type* __s2, size_t __n)
! { return (char_type*) memmove(__s1, __s2, __n * sizeof(char_type)); }
static char_type*
copy(char_type* __s1, const char_type* __s2, size_t __n)
! { return (char_type*) memcpy(__s1, __s2, __n * sizeof(char_type)); }
static char_type*
assign(char_type* __s, size_t __n, char_type __a)
--- 93,103 ----
static char_type*
move(char_type* __s1, const char_type* __s2, size_t __n)
! { return (char_type*) std::memmove(__s1, __s2, __n * sizeof(char_type)); }
static char_type*
copy(char_type* __s1, const char_type* __s2, size_t __n)
! { return (char_type*) std::memcpy(__s1, __s2, __n * sizeof(char_type)); }
static char_type*
assign(char_type* __s, size_t __n, char_type __a)
Index: testsuite/27_io/filebuf_virtuals.cc
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/testsuite/27_io/filebuf_virtuals.cc,v
retrieving revision 1.1
diff -c -p -r1.1 filebuf_virtuals.cc
*** filebuf_virtuals.cc 2001/05/22 18:48:19 1.1
--- filebuf_virtuals.cc 2001/06/01 02:13:57
*************** void test01()
*** 30,41 ****
bool test = true;
char buf[512];
const char* strlit = "how to tell a story and other essays: mark twain";
! const size_t strlitsize = strlen(strlit);
filebuf fbuf01;
fbuf01.pubsetbuf(buf, 512);
fbuf01.sputn(strlit, strlitsize);
! VERIFY( strncmp(strlit, buf, strlitsize) != 0 );
}
void test02()
--- 30,41 ----
bool test = true;
char buf[512];
const char* strlit = "how to tell a story and other essays: mark twain";
! const size_t strlitsize = std::strlen(strlit);
filebuf fbuf01;
fbuf01.pubsetbuf(buf, 512);
fbuf01.sputn(strlit, strlitsize);
! VERIFY( std::strncmp(strlit, buf, strlitsize) != 0 );
}
void test02()
*************** void test02()
*** 45,57 ****
bool test = true;
char buf[512];
const char* strlit = "how to tell a story and other essays: mark twain";
! const size_t strlitsize = strlen(strlit);
filebuf fbuf01;
fbuf01.open("tmp", ios_base::out);
fbuf01.pubsetbuf(buf, strlitsize);
fbuf01.sputn(strlit, strlitsize);
! VERIFY( strncmp(strlit, buf, strlitsize) == 0 );
}
main()
--- 45,57 ----
bool test = true;
char buf[512];
const char* strlit = "how to tell a story and other essays: mark twain";
! const size_t strlitsize = std::strlen(strlit);
filebuf fbuf01;
fbuf01.open("tmp", ios_base::out);
fbuf01.pubsetbuf(buf, strlitsize);
fbuf01.sputn(strlit, strlitsize);
! VERIFY( std::strncmp(strlit, buf, strlitsize) == 0 );
}
main()
Index: testsuite/27_io/stringbuf_virtuals.cc
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/testsuite/27_io/stringbuf_virtuals.cc,v
retrieving revision 1.1
diff -c -p -r1.1 stringbuf_virtuals.cc
*** stringbuf_virtuals.cc 2001/05/22 18:48:19 1.1
--- stringbuf_virtuals.cc 2001/06/01 02:13:57
*************** void test01()
*** 30,41 ****
bool test = true;
char buf[512];
const char* strlit = "how to tell a story and other essays: mark twain";
! const size_t strlitsize = strlen(strlit);
stringbuf sbuf(ios_base::out);
sbuf.pubsetbuf(buf, strlitsize);
sbuf.sputn(strlit, strlitsize);
! VERIFY( strncmp(strlit, buf, strlitsize) != 0 );
}
int main()
--- 30,41 ----
bool test = true;
char buf[512];
const char* strlit = "how to tell a story and other essays: mark twain";
! const size_t strlitsize = std::strlen(strlit);
stringbuf sbuf(ios_base::out);
sbuf.pubsetbuf(buf, strlitsize);
sbuf.sputn(strlit, strlitsize);
! VERIFY( std::strncmp(strlit, buf, strlitsize) != 0 );
}
int main()
More information about the Libstdc++
mailing list