This is the mail archive of the libstdc++@sources.redhat.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]

regular and shadow header and testsuite patch


  Attached are 2 patches.  Patch 1 fixes a few problems in the both the
regular and shadow headers.  With it applied, I get a pass/fail of 170/12 for
the normal (non-shadow-header) configuration.

  Patch 2 fixes a few problems with the testsuite that cause a number of
failures when shadow headers are enabled.  With it applied (and some grotty
hackery for the signal.h mess which I'm not including), I get a pass/fail of
170/12 for shadow-header configuration.  However, it also correctly detects a
number of non-conformances in the non-shadow configuration, that is, the
non-shadow headers now have a bunch more failures...


Index: libstdc++-v3/include/bits/codecvt.h
===================================================================
RCS file: /cvs/gcc/egcs/libstdc++-v3/include/bits/codecvt.h,v
retrieving revision 1.2
diff -c -p -3 -r1.2 codecvt.h
*** codecvt.h	2000/10/20 06:51:59	1.2
--- codecvt.h	2000/10/27 16:43:56
*************** namespace std
*** 407,419 ****
  	      __cfixed[0] = static_cast<intern_type>(__int_bom);
  	      char_traits<intern_type>::copy(__cfixed + 1, __from, __size);
  	      __cfrom = reinterpret_cast<char*>(__cfixed);
! 	      __conv = iconv(*__desc, &__cfrom, &__flen, &__cto, &__tlen); 
  	    }
  	  else
  	    {
  	      intern_type* __cfixed = const_cast<intern_type*>(__from);
  	      __cfrom = reinterpret_cast<char*>(__cfixed);
! 	      __conv = iconv(*__desc, &__cfrom, &__flen, &__cto, &__tlen); 
  	    }
  
  	  if (__conv != size_t(-1))
--- 407,419 ----
  	      __cfixed[0] = static_cast<intern_type>(__int_bom);
  	      char_traits<intern_type>::copy(__cfixed + 1, __from, __size);
  	      __cfrom = reinterpret_cast<char*>(__cfixed);
! 	      __conv = iconv(*__desc, const_cast<const char**>(&__cfrom), &__flen, &__cto, &__tlen); 
  	    }
  	  else
  	    {
  	      intern_type* __cfixed = const_cast<intern_type*>(__from);
  	      __cfrom = reinterpret_cast<char*>(__cfixed);
! 	      __conv = iconv(*__desc, const_cast<const char**>(&__cfrom), &__flen, &__cto, &__tlen); 
  	    }
  
  	  if (__conv != size_t(-1))
*************** namespace std
*** 509,521 ****
  	      __cfixed[0] = static_cast<extern_type>(__ext_bom);
  	      char_traits<extern_type>::copy(__cfixed + 1, __from, __size);
  	      __cfrom = reinterpret_cast<char*>(__cfixed);
! 	      __conv = iconv(*__desc, &__cfrom, &__flen, &__cto, &__tlen); 
  	    }
  	  else
  	    {
  	      extern_type* __cfixed = const_cast<extern_type*>(__from);
  	      __cfrom = reinterpret_cast<char*>(__cfixed);
! 	      __conv = iconv(*__desc, &__cfrom, &__flen, &__cto, &__tlen); 
  	    }
  
  	  
--- 509,521 ----
  	      __cfixed[0] = static_cast<extern_type>(__ext_bom);
  	      char_traits<extern_type>::copy(__cfixed + 1, __from, __size);
  	      __cfrom = reinterpret_cast<char*>(__cfixed);
! 	      __conv = iconv(*__desc, const_cast<const char**>(&__cfrom), &__flen, &__cto, &__tlen); 
  	    }
  	  else
  	    {
  	      extern_type* __cfixed = const_cast<extern_type*>(__from);
  	      __cfrom = reinterpret_cast<char*>(__cfixed);
! 	      __conv = iconv(*__desc, const_cast<const char**>(&__cfrom), &__flen, &__cto, &__tlen); 
  	    }
  
  	  
Index: libstdc++-v3/include/c_std/stdio.h
===================================================================
RCS file: /cvs/gcc/egcs/libstdc++-v3/include/c_std/stdio.h,v
retrieving revision 1.2
diff -c -p -3 -r1.2 stdio.h
*** stdio.h	2000/10/24 17:00:58	1.2
--- stdio.h	2000/10/27 16:43:56
***************
*** 57,63 ****
    using std::setvbuf;
    using std::fprintf;
    using std::fscanf;
! //  using std::printf;
    using std::scanf;
    using std::sprintf;
    using std::sscanf;
--- 57,63 ----
    using std::setvbuf;
    using std::fprintf;
    using std::fscanf;
!   using std::printf;
    using std::scanf;
    using std::sprintf;
    using std::sscanf;
Index: libstdc++-v3/include/c_std/bits/std_cstdio.h
===================================================================
RCS file: /cvs/gcc/egcs/libstdc++-v3/include/c_std/bits/std_cstdio.h,v
retrieving revision 1.3
diff -c -p -3 -r1.3 std_cstdio.h
*** std_cstdio.h	2000/10/24 17:00:58	1.3
--- std_cstdio.h	2000/10/27 16:43:56
*************** namespace std {
*** 133,139 ****
    using _C_legacy::remove;
    using _C_legacy::rename;
    using _C_legacy::tmpnam;
!   //  using _C_legacy::printf;
    using _C_legacy::scanf;
    using _C_legacy::sprintf;
    using _C_legacy::sscanf;
--- 133,139 ----
    using _C_legacy::remove;
    using _C_legacy::rename;
    using _C_legacy::tmpnam;
!   using _C_legacy::printf;
    using _C_legacy::scanf;
    using _C_legacy::sprintf;
    using _C_legacy::sscanf;
Index: libstdc++-v3/mkcheck.in
===================================================================
RCS file: /cvs/gcc/egcs/libstdc++-v3/mkcheck.in,v
retrieving revision 1.27
diff -c -p -3 -r1.27 mkcheck.in
*** mkcheck.in	2000/10/26 07:28:25	1.27
--- mkcheck.in	2000/10/27 16:43:56
*************** fi
*** 57,63 ****
  top_srcdir=@top_srcdir@
  C_DIR="`basename @C_INCLUDE_DIR@`"
  if [ $WHICH != "1" ]; then
!   INC_PATH="@CSHADOW_FLAGS@ -I$BUILD_DIR -I$BUILD_DIR/libio \
      -I$SRC_DIR/include/std  -I$SRC_DIR/include/$C_DIR \
      -I$SRC_DIR/include -I$SRC_DIR/libsupc++ -I$SRC_DIR/libio \
      -I$SRC_DIR/testsuite"
--- 57,63 ----
  top_srcdir=@top_srcdir@
  C_DIR="`basename @C_INCLUDE_DIR@`"
  if [ $WHICH != "1" ]; then
!   INC_PATH="-nostdinc++ @CSHADOW_FLAGS@ -I$BUILD_DIR -I$BUILD_DIR/libio \
      -I$SRC_DIR/include/std  -I$SRC_DIR/include/$C_DIR \
      -I$SRC_DIR/include -I$SRC_DIR/libsupc++ -I$SRC_DIR/libio \
      -I$SRC_DIR/testsuite"
Index: libstdc++-v3/testsuite/22_locale/codecvt_wchar_t_char.cc
===================================================================
RCS file: /cvs/gcc/egcs/libstdc++-v3/testsuite/22_locale/codecvt_wchar_t_char.cc,v
retrieving revision 1.1
diff -c -p -3 -r1.1 codecvt_wchar_t_char.cc
*** codecvt_wchar_t_char.cc	2000/08/22 08:19:00	1.1
--- codecvt_wchar_t_char.cc	2000/10/27 16:43:56
***************
*** 20,25 ****
--- 20,26 ----
  
  // 22.2.1.5 - Template class codecvt [lib.locale.codecvt]
  
+ #include <cwchar> // for mbstate_t
  #include <locale>
  #include <debug_assert.h>
  
***************
*** 34,41 ****
  //   w_codecvt::state_type state01 = {0, 0};
  // .. except Ulrich says: Use memset. Always use memset. Feel the force...
  void
! zero_state(mbstate_t& state)
! { memset(&state, 0, sizeof(mbstate_t)); }
  
  // Required instantiation
  // codecvt<wchar_t, char, mbstate_t>
--- 35,42 ----
  //   w_codecvt::state_type state01 = {0, 0};
  // .. except Ulrich says: Use memset. Always use memset. Feel the force...
  void
! zero_state(std::mbstate_t& state)
! { std::memset(&state, 0, sizeof(std::mbstate_t)); }
  
  // Required instantiation
  // codecvt<wchar_t, char, mbstate_t>
Index: libstdc++-v3/testsuite/22_locale/ctor_copy_dtor.cc
===================================================================
RCS file: /cvs/gcc/egcs/libstdc++-v3/testsuite/22_locale/ctor_copy_dtor.cc,v
retrieving revision 1.4
diff -c -p -3 -r1.4 ctor_copy_dtor.cc
*** ctor_copy_dtor.cc	2000/09/19 06:47:52	1.4
--- ctor_copy_dtor.cc	2000/10/27 16:43:56
***************
*** 20,33 ****
  
  // 22.1.1.2 locale constructors and destructors [lib.locale.cons]
  
  #include <locale>
  #include <stdexcept>
  #include <debug_assert.h>
  
! typedef std::codecvt<char, char, mbstate_t> 		c_codecvt;
! typedef std::codecvt_byname<char, char, mbstate_t> 	c_codecvt_byname;
! typedef std::codecvt<wchar_t, char, mbstate_t>		w_codecvt;
! typedef std::codecvt_byname<wchar_t, char, mbstate_t>	w_codecvt_byname;
  
  class gnu_codecvt: public c_codecvt { }; 
  
--- 20,34 ----
  
  // 22.1.1.2 locale constructors and destructors [lib.locale.cons]
  
+ #include <cwchar> // for mbstate_t
  #include <locale>
  #include <stdexcept>
  #include <debug_assert.h>
  
! typedef std::codecvt<char, char, std::mbstate_t> 		c_codecvt;
! typedef std::codecvt_byname<char, char, std::mbstate_t> 	c_codecvt_byname;
! typedef std::codecvt<wchar_t, char, std::mbstate_t>		w_codecvt;
! typedef std::codecvt_byname<wchar_t, char, std::mbstate_t>	w_codecvt_byname;
  
  class gnu_codecvt: public c_codecvt { }; 
  
Index: libstdc++-v3/testsuite/22_locale/facet.cc
===================================================================
RCS file: /cvs/gcc/egcs/libstdc++-v3/testsuite/22_locale/facet.cc,v
retrieving revision 1.2
diff -c -p -3 -r1.2 facet.cc
*** facet.cc	2000/09/12 18:50:16	1.2
--- facet.cc	2000/10/27 16:43:56
***************
*** 20,25 ****
--- 20,26 ----
  
  // 22.1.1.1.2 - class locale::facet [lib.locale.facet]
  
+ #include <cwchar> // for mbstate_t
  #include <locale>
  #include <iterator>
  #include <debug_assert.h>
*************** typedef std::ostreambuf_iterator<char>		
*** 30,36 ****
  
  class gnu_collate: public std::collate<char> { }; 
  class gnu_ctype: public std::ctype<char> { }; 
! class gnu_codecvt: public std::codecvt<char, char, mbstate_t> { }; 
  class gnu_moneypunct: public std::moneypunct<char> { }; 
  class gnu_moneypunct_true: public std::moneypunct<char, true> { }; 
  class gnu_money_get: public std::money_get<char> { }; 
--- 31,37 ----
  
  class gnu_collate: public std::collate<char> { }; 
  class gnu_ctype: public std::ctype<char> { }; 
! class gnu_codecvt: public std::codecvt<char, char, std::mbstate_t> { }; 
  class gnu_moneypunct: public std::moneypunct<char> { }; 
  class gnu_moneypunct_true: public std::moneypunct<char, true> { }; 
  class gnu_money_get: public std::money_get<char> { }; 
Index: libstdc++-v3/testsuite/22_locale/global_templates.cc
===================================================================
RCS file: /cvs/gcc/egcs/libstdc++-v3/testsuite/22_locale/global_templates.cc,v
retrieving revision 1.3
diff -c -p -3 -r1.3 global_templates.cc
*** global_templates.cc	2000/09/19 06:47:52	1.3
--- global_templates.cc	2000/10/27 16:43:56
***************
*** 20,29 ****
  
  // 22.1.2 locale globals [lib.locale.global.templates]
  
  #include <locale>
  #include <debug_assert.h>
  
! typedef std::codecvt<char, char, mbstate_t> ccodecvt;
  
  class gnu_codecvt: public ccodecvt { }; 
  
--- 20,30 ----
  
  // 22.1.2 locale globals [lib.locale.global.templates]
  
+ #include <cwchar> // for mbstate_t
  #include <locale>
  #include <debug_assert.h>
  
! typedef std::codecvt<char, char, std::mbstate_t> ccodecvt;
  
  class gnu_codecvt: public ccodecvt { }; 
  
Index: libstdc++-v3/testsuite/22_locale/operators.cc
===================================================================
RCS file: /cvs/gcc/egcs/libstdc++-v3/testsuite/22_locale/operators.cc,v
retrieving revision 1.1
diff -c -p -3 -r1.1 operators.cc
*** operators.cc	2000/09/12 18:47:05	1.1
--- operators.cc	2000/10/27 16:43:56
***************
*** 20,29 ****
  
  // 22.1.1.4 locale operators [lib.locale.operators]
  
  #include <locale>
  #include <debug_assert.h>
  
! typedef std::codecvt<char, char, mbstate_t> ccodecvt;
  class gnu_codecvt: public ccodecvt { }; 
  
  void test01()
--- 20,30 ----
  
  // 22.1.1.4 locale operators [lib.locale.operators]
  
+ #include <cwchar> // for mbstate_t
  #include <locale>
  #include <debug_assert.h>
  
! typedef std::codecvt<char, char, std::mbstate_t> ccodecvt;
  class gnu_codecvt: public ccodecvt { }; 
  
  void test01()
Index: libstdc++-v3/testsuite/22_locale/static_members.cc
===================================================================
RCS file: /cvs/gcc/egcs/libstdc++-v3/testsuite/22_locale/static_members.cc,v
retrieving revision 1.1
diff -c -p -3 -r1.1 static_members.cc
*** static_members.cc	2000/09/14 19:11:14	1.1
--- static_members.cc	2000/10/27 16:43:56
***************
*** 20,29 ****
  
  // 22.1.1.5 locale static members [lib.locale.statics]
  
  #include <locale>
  #include <debug_assert.h>
  
! typedef std::codecvt<char, char, mbstate_t> ccodecvt;
  class gnu_codecvt: public ccodecvt { }; 
  
  void test01()
--- 20,30 ----
  
  // 22.1.1.5 locale static members [lib.locale.statics]
  
+ #include <cwchar> // for mbstate_t
  #include <locale>
  #include <debug_assert.h>
  
! typedef std::codecvt<char, char, std::mbstate_t> ccodecvt;
  class gnu_codecvt: public ccodecvt { }; 
  
  void test01()
Index: libstdc++-v3/testsuite/26_numerics/c_math.cc
===================================================================
RCS file: /cvs/gcc/egcs/libstdc++-v3/testsuite/26_numerics/c_math.cc,v
retrieving revision 1.2
diff -c -p -3 -r1.2 c_math.cc
*** c_math.cc	2000/08/14 19:59:25	1.2
--- c_math.cc	2000/10/27 16:43:56
*************** test01()
*** 36,42 ****
  int
  test02()
  {
!   sin(static_cast<float>(0));
    return 0;
  }
  
--- 36,42 ----
  int
  test02()
  {
! 	std::sin(static_cast<float>(0));
    return 0;
  }
  
*************** test02()
*** 44,50 ****
  int
  test03()
  {
!   double powtest = pow(2., 0);
    return 0;
  }
  
--- 44,50 ----
  int
  test03()
  {
!   double powtest = std::pow(2., 0);
    return 0;
  }
  
Index: libstdc++-v3/testsuite/26_numerics/complex_inserters_extractors.cc
===================================================================
RCS file: /cvs/gcc/egcs/libstdc++-v3/testsuite/26_numerics/complex_inserters_extractors.cc,v
retrieving revision 1.4
diff -c -p -3 -r1.4 complex_inserters_extractors.cc
*** complex_inserters_extractors.cc	2000/08/14 19:59:25	1.4
--- complex_inserters_extractors.cc	2000/10/27 16:43:56
*************** template<typename R>
*** 31,37 ****
  inline bool flteq(R x, R y)
  {
    if (x == R(0)) return y == R(0);
!   else return fabs(x-y) < 1e-6*fabs(x);
  }
  
  template<typename R>
--- 31,37 ----
  inline bool flteq(R x, R y)
  {
    if (x == R(0)) return y == R(0);
!   else return std::fabs(x-y) < 1e-6*std::fabs(x);
  }
  
  template<typename R>
Index: libstdc++-v3/testsuite/27_io/fpos.cc
===================================================================
RCS file: /cvs/gcc/egcs/libstdc++-v3/testsuite/27_io/fpos.cc,v
retrieving revision 1.2
diff -c -p -3 -r1.2 fpos.cc
*** fpos.cc	2000/08/14 19:59:25	1.2
--- fpos.cc	2000/10/27 16:43:56
***************
*** 29,34 ****
--- 29,35 ----
  
  // 27.4.3 template class fpos
  
+ #include <cwchar> // for mbstate_t
  #include <ios>
  #include <debug_assert.h>
  
*************** void test01()
*** 36,42 ****
  {
    bool test = true;
  
!   typedef mbstate_t state_type;
    state_type state01;
    state_type state02;
  
--- 37,43 ----
  {
    bool test = true;
  
!   typedef std::mbstate_t state_type;
    state_type state01;
    state_type state02;
  
*************** void test02()
*** 72,78 ****
  {
    bool test = true;
  
!   typedef mbstate_t state_type;
    state_type state01;
    state_type state02;
  
--- 73,79 ----
  {
    bool test = true;
  
!   typedef std::mbstate_t state_type;
    state_type state01;
    state_type state02;
  
*************** void test03()
*** 132,138 ****
  {
    bool test = true;
  
!   typedef mbstate_t state_type;
    state_type state01;
    state_type state02;
  
--- 133,139 ----
  {
    bool test = true;
  
!   typedef std::mbstate_t state_type;
    state_type state01;
    state_type state02;
  
Index: libstdc++-v3/testsuite/27_io/istream_extractor_arith.cc
===================================================================
RCS file: /cvs/gcc/egcs/libstdc++-v3/testsuite/27_io/istream_extractor_arith.cc,v
retrieving revision 1.5
diff -c -p -3 -r1.5 istream_extractor_arith.cc
*** istream_extractor_arith.cc	2000/08/14 19:59:25	1.5
--- istream_extractor_arith.cc	2000/10/27 16:43:56
***************
*** 20,25 ****
--- 20,26 ----
  
  // 27.6.1.2.2 arithmetic extractors
  
+ #include <cstdio> // for printf
  #include <istream>
  #include <ostream>
  #include <sstream>
*************** bool test01() {
*** 105,113 ****
    VERIFY( f1 == 1.5 );
  
    is_04 >> std::hex >> i1;
!   printf ("%d %d %d\n", i1, i1 == 0x123, test);
    VERIFY( i1 == 0x123 );
!   printf ("%d %d %d\n", i1, i1 == 0x123, test);
  
    // test void pointers
    int i = 55;
--- 106,114 ----
    VERIFY( f1 == 1.5 );
  
    is_04 >> std::hex >> i1;
!   std::printf ("%d %d %d\n", i1, i1 == 0x123, test);
    VERIFY( i1 == 0x123 );
!   std::printf ("%d %d %d\n", i1, i1 == 0x123, test);
  
    // test void pointers
    int i = 55;
*************** bool test01() {
*** 116,122 ****
  
    ss_01 << po;
    ss_01 >> pi;
!   printf ("%x %x\n", pi, po);
    VERIFY( po == pi );
    
  #ifdef DEBUG_ASSERT
--- 117,123 ----
  
    ss_01 << po;
    ss_01 >> pi;
!   std::printf ("%x %x\n", pi, po);
    VERIFY( po == pi );
    
  #ifdef DEBUG_ASSERT
Index: libstdc++-v3/testsuite/27_io/istream_unformatted.cc
===================================================================
RCS file: /cvs/gcc/egcs/libstdc++-v3/testsuite/27_io/istream_unformatted.cc,v
retrieving revision 1.6
diff -c -p -3 -r1.6 istream_unformatted.cc
*** istream_unformatted.cc	2000/10/06 07:12:32	1.6
--- istream_unformatted.cc	2000/10/27 16:43:56
***************
*** 20,25 ****
--- 20,26 ----
  
  // 27.6.1.3 unformatted input functions
  
+ #include <cstring> // for strncmp,...
  #include <istream>
  #include <sstream>
  #include <fstream>
*************** test01()
*** 56,62 ****
    is_04.read(carray, 9);
    state2 = is_04.rdstate();
    VERIFY( state1 == state2 );
!   VERIFY( !strncmp(carray, "soul eyes", 9) );
    VERIFY( is_04.peek() == ':' );
  
    state1 = is_03.rdstate();
--- 57,63 ----
    is_04.read(carray, 9);
    state2 = is_04.rdstate();
    VERIFY( state1 == state2 );
!   VERIFY( !std::strncmp(carray, "soul eyes", 9) );
    VERIFY( is_04.peek() == ':' );
  
    state1 = is_03.rdstate();
*************** test01()
*** 65,71 ****
    VERIFY( state1 != state2 );
    VERIFY( static_cast<bool>(state2 & stateeof) ); 
    VERIFY( static_cast<bool>(state2 & statefail) ); 
!   VERIFY( !strncmp(carray, "soul eyes: john coltrane quartet", 35) );
  
  
    // istream& ignore(streamsize n = 1, int_type delim = traits::eof())
--- 66,72 ----
    VERIFY( state1 != state2 );
    VERIFY( static_cast<bool>(state2 & stateeof) ); 
    VERIFY( static_cast<bool>(state2 & statefail) ); 
!   VERIFY( !std::strncmp(carray, "soul eyes: john coltrane quartet", 35) );
  
  
    // istream& ignore(streamsize n = 1, int_type delim = traits::eof())
*************** aaaaaaaaaaaaaa
*** 377,383 ****
    char tmp[it];
    std::stringbuf sb(charray, std::ios_base::in);
    std::istream ifs(&sb);
!   std::streamsize blen = strlen(charray);
    VERIFY(ifs);
    while(ifs.getline(tmp, it) || ifs.gcount())
      {
--- 378,384 ----
    char tmp[it];
    std::stringbuf sb(charray, std::ios_base::in);
    std::istream ifs(&sb);
!   std::streamsize blen = std::strlen(charray);
    VERIFY(ifs);
    while(ifs.getline(tmp, it) || ifs.gcount())
      {
*************** aaaaaaaaaaaaaa
*** 401,407 ****
  	  // or
  	  // -> n - 1 characters are stored
            ifs.clear(ifs.rdstate() & ~std::ios::failbit);
!           VERIFY((ifs.gcount() == 0) || (strlen(tmp) == it - 1));
            VERIFY(ifs);
            continue;
          }
--- 402,408 ----
  	  // or
  	  // -> n - 1 characters are stored
            ifs.clear(ifs.rdstate() & ~std::ios::failbit);
!           VERIFY((ifs.gcount() == 0) || (std::strlen(tmp) == it - 1));
            VERIFY(ifs);
            continue;
          }
*************** aaaaaaaaaaaaaa
*** 411,417 ****
  	  //
  	  // -> strlen(__s) < n - 1 
  	  // -> delimiter was seen -> gcount() > strlen(__s)
!           VERIFY(ifs.gcount() == strlen(tmp) + 1);
            continue;
          }
      }
--- 412,418 ----
  	  //
  	  // -> strlen(__s) < n - 1 
  	  // -> delimiter was seen -> gcount() > strlen(__s)
!           VERIFY(ifs.gcount() == std::strlen(tmp) + 1);
            continue;
          }
      }
Index: libstdc++-v3/testsuite/27_io/ostream_inserter_arith.cc
===================================================================
RCS file: /cvs/gcc/egcs/libstdc++-v3/testsuite/27_io/ostream_inserter_arith.cc,v
retrieving revision 1.4
diff -c -p -3 -r1.4 ostream_inserter_arith.cc
*** ostream_inserter_arith.cc	2000/08/14 19:59:25	1.4
--- ostream_inserter_arith.cc	2000/10/27 16:43:57
***************
*** 19,24 ****
--- 19,25 ----
  // Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
  // USA.
  
+ #include <cstdio> // for sprintf
  #include <iostream>
  #include <iomanip>
  #include <locale>
Index: libstdc++-v3/testsuite/27_io/streambuf.cc
===================================================================
RCS file: /cvs/gcc/egcs/libstdc++-v3/testsuite/27_io/streambuf.cc,v
retrieving revision 1.2
diff -c -p -3 -r1.2 streambuf.cc
*** streambuf.cc	2000/08/14 19:59:26	1.2
--- streambuf.cc	2000/10/27 16:43:57
***************
*** 29,34 ****
--- 29,35 ----
  
  // 27.5.2 template class basic_streambuf
  
+ #include <cstring> // for memset, memcmp
  #include <streambuf>
  #include <ostream>
  #include <debug_assert.h>
*************** void test01()
*** 131,139 ****
  
    // sputn/xsputn
    char* lit02 = "isotope 217: the unstable molecule on thrill jockey";
!   int i02 = strlen(lit02);
    char carray[i02 + 1];
!   memset(carray, 0, i02 + 1);
  
    buf01.pub_setp(carray, (carray + i02));
    buf01.sputn(lit02, 0);
--- 132,140 ----
  
    // sputn/xsputn
    char* lit02 = "isotope 217: the unstable molecule on thrill jockey";
!   int i02 = std::strlen(lit02);
    char carray[i02 + 1];
!   std::memset(carray, 0, i02 + 1);
  
    buf01.pub_setp(carray, (carray + i02));
    buf01.sputn(lit02, 0);
*************** void test01()
*** 144,152 ****
    VERIFY( lit02[1] == 's' );
    VERIFY( carray[1] == 0 );
    buf01.sputn(lit02 + 1, 10);
!   VERIFY( memcmp(lit02, carray, 10) == 0 );
    buf01.sputn(lit02 + 11, 20);
!   VERIFY( memcmp(lit02, carray, 30) == 0 );
  
  #ifdef DEBUG_ASSERT
    assert(test);
--- 145,153 ----
    VERIFY( lit02[1] == 's' );
    VERIFY( carray[1] == 0 );
    buf01.sputn(lit02 + 1, 10);
!   VERIFY( std::memcmp(lit02, carray, 10) == 0 );
    buf01.sputn(lit02 + 11, 20);
!   VERIFY( std::memcmp(lit02, carray, 30) == 0 );
  
  #ifdef DEBUG_ASSERT
    assert(test);
*************** void test02()
*** 172,178 ****
    // 27.5.2.2.5 Put area
    size_t i01 = traits_type::length(lit01);
    char carray01[i01];
!   memset(carray01, 0, i01);
    
    buf01.pub_setg(lit01, lit01, lit01 + i01);
    buf01.sgetn(carray01, 0);
--- 173,179 ----
    // 27.5.2.2.5 Put area
    size_t i01 = traits_type::length(lit01);
    char carray01[i01];
!   std::memset(carray01, 0, i01);
    
    buf01.pub_setg(lit01, lit01, lit01 + i01);
    buf01.sgetn(carray01, 0);

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