]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - libstdc++-v3/testsuite/22_locale/ctype/widen/wchar_t/1.cc
locale_facets.tcc: Tweak to avoid warnings.
[thirdparty/gcc.git] / libstdc++-v3 / testsuite / 22_locale / ctype / widen / wchar_t / 1.cc
index 042a0b5f705e6afd7bb18eeeb2f1c854ccb1786e..7e2377475e0d593b437b00d7695b0a1f066de2eb 100644 (file)
@@ -38,8 +38,7 @@ void test01()
   using namespace std;
   typedef wchar_t wide_type;
 
-  bool test = true;
-  const char dfault = '?';
+  bool test __attribute__((unused)) = true;
   const locale loc_c = locale::classic();
   const ctype<wide_type>& ctype_c = use_facet<ctype<wide_type> >(loc_c); 
 
@@ -48,7 +47,7 @@ void test01()
   vector<wide_type>            wide_chars(narrow.length() + 1);
   
   // widen(char c) const
-  for (int i = 0; i < narrow.length(); ++i)
+  for (size_t i = 0; i < narrow.length(); ++i)
     {
       char c = ctype_c.widen(narrow[i]);
       VERIFY( c == wide[i] );
@@ -56,7 +55,7 @@ void test01()
 
   // widen(const char* low, const char* high, charT* dest) const
   ctype_c.widen(&narrow[0], &narrow[0] + narrow.length(), &wide_chars[0]);  
-  for (int i = 0; i < narrow.length(); ++i)
+  for (size_t i = 0; i < narrow.length(); ++i)
     VERIFY( wide_chars[i] == wide[i] );
 }