+2003-09-23 Benjamin Kosnik <bkoz@redhat.com>
+
+ * include/bits/locale_facets.tcc: Tweak to avoid warnings.
+ * testsuite/testsuite_hooks.h: Same.
+ * testsuite/*/*.cc: Same.
+
2003-09-22 Petur Runolfsson <peturr02@ru.is>
* include/bits/istream.tcc (basic_istream::read,
const locale::facet** __caches = __loc._M_impl->_M_caches;
if (!__caches[__i])
{
- __numpunct_cache<_CharT>* __tmp;
+ __numpunct_cache<_CharT>* __tmp = NULL;
try
{
__tmp = new __numpunct_cache<_CharT>;
// 2001-02-06 Benjamin Kosnik <bkoz@redhat.com>
-// Copyright (C) 2001 Free Software Foundation, Inc.
+// Copyright (C) 2001, 2003 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
namespace gnu
{
- void test01()
+ int test01()
{
int i = errno;
#ifndef errno
#error "errno_must_be_a_macro"
#endif
+ return i;
}
}
+++ /dev/null
-// 1999-05-20 bkoz
-
-// Copyright (C) 1999, 2003 Free Software Foundation, Inc.
-//
-// This file is part of the GNU ISO C++ Library. This library is free
-// software; you can redistribute it and/or modify it under the
-// terms of the GNU General Public License as published by the
-// Free Software Foundation; either version 2, or (at your option)
-// any later version.
-
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License along
-// with this library; see the file COPYING. If not, write to the Free
-// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-// USA.
-
-// 17.4.1.2 Headers, ciso646
-
-// { dg-do link }
-
-#include <ciso646>
-#include <testsuite_hooks.h>
-
-
-// 2.11 Keywords
-// alternative representations
-// and, and_eq, bitand, bitor, compl, not, not_eq, or, or_eq, xor, xor_eq
-
-// C 2.2.2 Header <iso646.h>
-// The tokens (as above) are keywords and do not appear as macros in <ciso646>.
-
-// Test for macros.
-bool test01()
-{
- bool test = true;
-
-#if 0
-
-#ifdef and
- test = false;
-#endif
-
-#ifdef and_eq
- test = false;
-#endif
-
-#ifdef bitand
- test = false;
-#endif
-
-#ifdef bitor
- test = false;
-#endif
-
-#ifdef compl
- test = false;
-#endif
-
-#ifdef not_eq
- test = false;
-#endif
-
-#ifdef not_or
- test = false;
-#endif
-
-#ifdef or
- test = false;
-#endif
-
-#ifdef or_eq
- test = false;
-#endif
-
-#ifdef xor
- test = false;
-#endif
-
-#ifdef xor_eq
- test = false;
-#endif
-
-#endif
-
- return test;
-}
-
-
-// Equivalance in usage.
-bool test02()
-{
- bool test = true;
-
- bool arg1 = true;
- bool arg2 = false;
- int int1 = 45;
- int int2 = 0;
-
- VERIFY( arg1 && int1 );
- VERIFY( arg1 and int1 );
-
- VERIFY( (arg1 && arg2) == (arg1 and arg2) );
- VERIFY( (arg1 && int1) == (arg1 and int1) );
-
- return test;
-}
-
-
-int main(void)
-{
- test01();
- test02();
-
- return 0;
-}
// 2001-02-06 Benjamin Kosnik <bkoz@redhat.com>
-// Copyright (C) 2001 Free Software Foundation, Inc.
+// Copyright (C) 2001, 2003 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
void test01()
{
std::jmp_buf env;
- int i = setjmp(env);
+ int i __attribute__((unused)) = setjmp(env);
#ifndef setjmp
#error "setjmp_must_be_a_macro"
#endif
// 2001-02-06 Benjamin Kosnik <bkoz@redhat.com>
-// Copyright (C) 2001 Free Software Foundation, Inc.
+// Copyright (C) 2001, 2003 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
{
void test01()
{
- std::va_list list;
+ std::va_list __attribute__((unused)) list;
#ifndef va_arg
#error "va_arg_must_be_a_macro"
#endif
// 2001-02-06 Benjamin Kosnik <bkoz@redhat.com>
-// Copyright (C) 2001 Free Software Foundation, Inc.
+// Copyright (C) 2001, 2003 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
void test01()
{
- std::size_t i = offsetof(struct test_type, i);
+ std::size_t i __attribute__((unused)) = offsetof(struct test_type, i);
#ifndef offsetof
#error "offsetof_must_be_a_macro"
#endif
// 2000-01-01 bkoz
-// Copyright (C) 2001 Free Software Foundation, Inc.
+// Copyright (C) 2001, 2003 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
int main(void)
{
// Make sure size_t is in namespace std
- std::size_t i = 5;
+ std::size_t i __attribute__((unused)) = 5;
return 0;
}
// 2000-01-01 bkoz
-// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
+// Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// libstdc++/2190
void test01()
{
- long a = std::abs(1L);
+ long a __attribute__((unused)) = std::abs(1L);
std::div(2L, 1L);
- std::ldiv_t b;
+ std::ldiv_t b __attribute__((unused));
}
void test02()
{
// Make sure size_t is in namespace std.
- std::size_t i = 5;
+ std::size_t i __attribute__((unused)) = 5;
}
int main()
// 2000-01-01 bkoz
-// Copyright (C) 2001 Free Software Foundation, Inc.
+// Copyright (C) 2001, 2003 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
int main(void)
{
// Make sure size_t is in namespace std
- std::size_t i = std::strlen("tibet shop/san francisco (415) 982-0326");
+ std::size_t i __attribute__((unused)) = std::strlen("tibet shop/san francisco (415) 982-0326");
return 0;
}
// 2000-01-01 bkoz
-// Copyright (C) 2001 Free Software Foundation, Inc.
+// Copyright (C) 2001, 2003 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
#include <ctime>
-
int main(void)
{
// Make sure size_t is in namespace std
- std::size_t i = 5;
+ std::size_t i __attribute__((unused)) = 5;
return 0;
}
// 2000-01-01 bkoz
-// Copyright (C) 2001 Free Software Foundation, Inc.
+// Copyright (C) 2001, 2003 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
int main(void)
{
// Make sure size_t is in namespace std
- std::size_t i = 5;
+ std::size_t i __attribute__((unused)) = 5;
- std::tm mytime;
+ std::tm __attribute__((unused)) mytime;
return 0;
}
template<typename T>
void test_extrema()
{
- bool test = true;
+ bool test __attribute__((unused)) = true;
T limits_min = std::numeric_limits<T>::min();
T limits_max = std::numeric_limits<T>::max();
T extrema_min = extrema<T>::min;
template<typename T>
void test_epsilon()
{
- bool test = true;
+ bool test __attribute__((unused)) = true;
T epsilon = std::numeric_limits<T>::epsilon();
T one = 1;
void test_sign()
{
- bool test = true;
+ bool test __attribute__((unused)) = true;
VERIFY( std::numeric_limits<char>::is_signed == char_is_signed );
VERIFY( std::numeric_limits<signed char>::is_signed == true );
VERIFY( std::numeric_limits<unsigned char>::is_signed == false );
bool test01()
{
- bool test = true;
+ bool test __attribute__((unused)) = true;
std::numeric_limits< A<B> > obj;
VERIFY( !obj.is_specialized );
typedef std::numeric_limits<B> b_nl_type;
// Should probably do all of them...
- const int* pi1 = &b_nl_type::digits;
- const int* pi2 = &b_nl_type::digits10;
- const int* pi3 = &b_nl_type::max_exponent10;
- const bool* pb1 = &b_nl_type::traps;
+ const int* __attribute__((unused)) pi1 = &b_nl_type::digits;
+ const int* __attribute__((unused)) pi2 = &b_nl_type::digits10;
+ const int* __attribute__((unused)) pi3 = &b_nl_type::max_exponent10;
+ const bool* __attribute__((unused)) pb1 = &b_nl_type::traps;
}
// libstdc++/5045
bool test03()
{
- bool test = true;
+ bool test __attribute__((unused)) = true;
VERIFY( std::numeric_limits<bool>::digits10 == 0 );
if (__CHAR_BIT__ == 8)
// libstdc++/8949
bool test04()
{
- bool test = true;
+ bool test __attribute__((unused)) = true;
VERIFY( !std::numeric_limits<short>::is_iec559 );
VERIFY( !std::numeric_limits<unsigned short>::is_iec559 );
// libstdc++/1972
void test01()
{
- bool test = true;
+ bool test __attribute__((unused)) = true;
std::string s("lack of sunlight, no water error");
// 1
void test02()
{
- bool test = true;
+ bool test __attribute__((unused)) = true;
std::string s("lack of sunlight error");
std::domain_error x(s);
void test03()
{
- bool test = true;
+ bool test __attribute__((unused)) = true;
try
{ throw fuzzy_logic(); }
catch(const fuzzy_logic& obj)
}
void test04()
{
- bool test = true;
+ bool test __attribute__((unused)) = true;
const std::string s("CA ISO emergency once again:immediate power down");
const char* strlit1 = "wish I lived in Palo Alto";
const char* strlit2 = "...or Santa Barbara";
void test01()
{
- bool test = true;
+ bool test __attribute__((unused)) = true;
std::allocator<gnu> obj;
// XXX These should work for various size allocation and
// libstdc++/8230
void test02()
{
- bool test = true;
+ bool test __attribute__((unused)) = true;
try
{
std::allocator<int> alloc;
-// Copyright (C) 2000, 2002 Free Software Foundation
+// Copyright (C) 2000, 2002, 2003 Free Software Foundation
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
int
test01()
{
- reset_count_struct reset;
- bool test = true;
+ reset_count_struct __attribute__((unused)) reset;
+ bool test __attribute__((unused)) = true;
std::auto_ptr<A> A_default;
VERIFY( A_default.get() == 0 );
int
test02()
{
- reset_count_struct reset;
- bool test = true;
+ reset_count_struct __attribute__((unused)) reset;
+ bool test __attribute__((unused)) = true;
std::auto_ptr<A> A_from_A(new A);
std::auto_ptr<B> B_from_B(new B);
int
test03()
{
- reset_count_struct reset;
- bool test = true;
+ reset_count_struct __attribute__((unused)) reset;
+ bool test __attribute__((unused)) = true;
std::auto_ptr<A> A_from_ptr_A;
std::auto_ptr<A> A_from_ptr_B;
int
test04()
{
- reset_count_struct reset;
- bool test = true;
+ reset_count_struct __attribute__((unused)) reset;
+ bool test __attribute__((unused)) = true;
{/*lifetine scope*/
std::auto_ptr<A> A_from_A(new A);
int
test05()
{
- bool test = true;
- reset_count_struct reset;
+ bool test __attribute__((unused)) = true;
+ reset_count_struct __attribute__((unused)) reset;
pimpl<A>();
pimpl<B>();
int
test06()
{
- reset_count_struct reset;
- bool test = true;
+ reset_count_struct __attribute__((unused)) reset;
+ bool test __attribute__((unused)) = true;
std::auto_ptr<A> A_from_A(new A);
std::auto_ptr<A> A_from_A_ptr(A_from_A.release());
int
test07()
{
- bool test = true;
- reset_count_struct reset;
+ bool test __attribute__((unused)) = true;
+ reset_count_struct __attribute__((unused)) reset;
drain(source<A>());
// The resolution of core issue 84, now a DR, breaks this call.
// 2001-06-11 Benjamin Kosnik <bkoz@redhat.com>
-// Copyright (C) 2001 Free Software Foundation, Inc.
+// Copyright (C) 2001, 2003 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
class Elem
{
public:
- void print(int i) const { }
- void modify(int i) { }
+ void print(int) const { }
+ void modify(int) { }
};
// libstdc++/3113
// heterogeneous
void test01()
{
- bool test = true;
+ bool test __attribute__((unused)) = true;
std::pair<bool, long> p_bl_1(true, 433);
std::pair<bool, long> p_bl_2 = std::make_pair(true, 433);
// homogeneous
void test02()
{
- bool test = true;
+ bool test __attribute__((unused)) = true;
std::pair<bool, bool> p_bb_1(true, false);
std::pair<bool, bool> p_bb_2 = std::make_pair(true, false);
// const
void test03()
{
- bool test = true;
+ bool test __attribute__((unused)) = true;
const std::pair<bool, long> p_bl_1(true, 433);
const std::pair<bool, long> p_bl_2 = std::make_pair(true, 433);
// const&
void test04()
{
- bool test = true;
+ bool test __attribute__((unused)) = true;
const gnu_obj& obj1 = gnu_obj(5);
const std::pair<const char*, gnu_obj> p_sg_1("enlightenment", obj1);
const std::pair<const char*, gnu_obj> p_sg_2 =
// 2001-06-18 Benjamin Kosnik <bkoz@redhat.com>
-// Copyright (C) 2001 Free Software Foundation, Inc.
+// Copyright (C) 2001, 2003 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
typedef raw_storage_iterator<long*, long> test_iterator;
typedef iterator<output_iterator_tag, void, void, void, void> base_iterator;
test_iterator rs_it(&l);
- base_iterator* base = &rs_it;
+ base_iterator* base __attribute__((unused)) = &rs_it;
// Check for required typedefs
typedef test_iterator::value_type value_type;
int main(void)
{
- bool test = true;
+ bool test __attribute__((unused)) = true;
std::pair<junk*,ptrdiff_t> results = std::get_temporary_buffer<junk>(5);
bool test01(void)
{
- bool test = true;
+ bool test __attribute__((unused)) = true;
typedef std::string::size_type csize_type;
typedef std::string::const_reference cref;
typedef std::string::reference ref;
- csize_type npos = std::string::npos;
- csize_type csz01, csz02;
+ csize_type csz01;
const char str_lit01[] = "point bolivar, texas";
const std::string str01(str_lit01);
bool test01(void)
{
- bool test = true;
+ bool test __attribute__((unused)) = true;
typedef std::wstring::size_type csize_type;
typedef std::wstring::const_reference cref;
typedef std::wstring::reference ref;
- csize_type npos = std::wstring::npos;
- csize_type csz01, csz02;
+ csize_type csz01;
const wchar_t str_lit01[] = L"point bolivar, texas";
const std::wstring str01(str_lit01);
void
test01()
{
- bool test = true;
+ bool test __attribute__((unused)) = true;
using namespace std;
void
test02()
{
- bool test = true;
+ bool test __attribute__((unused)) = true;
using namespace std;
void
test03()
{
- bool test = true;
+ bool test __attribute__((unused)) = true;
using namespace std;
void
test01()
{
- bool test = true;
+ bool test __attribute__((unused)) = true;
using namespace std;
void
test02()
{
- bool test = true;
+ bool test __attribute__((unused)) = true;
using namespace std;
void
test03()
{
- bool test = true;
+ bool test __attribute__((unused)) = true;
using namespace std;
void test01()
{
- bool test = true;
+ bool test __attribute__((unused)) = true;
// non POD types : resize, capacity, reserve
std::basic_string< A<B> > str02;
VERIFY( sz04 >= 100 );
str02.reserve();
sz03 = str02.capacity();
- VERIFY( sz03 >= 0 );
+ VERIFY( sz03 > 0 );
sz03 = str02.size() + 5;
str02.resize(sz03);
void test01()
{
// POD types : resize, capacity, reserve
- bool test = true;
+ bool test __attribute__((unused)) = true;
std::string str01;
typedef std::string::size_type size_type_s;
VERIFY( sz02 >= 100 );
str01.reserve();
sz01 = str01.capacity();
- VERIFY( sz01 >= 0 );
+ VERIFY( sz01 > 0 );
sz01 = str01.size() + 5;
str01.resize(sz01);
// trickster allocator issues involved with these:
std::string str3 = "8-chars_8-chars_";
- const char* p3 = str3.c_str();
std::string str4 = str3 + "7-chars";
- const char* p4 = str3.c_str();
sz01 = str01.size();
sz02 = str01.max_size();
// http://gcc.gnu.org/ml/libstdc++/2001-11/msg00150.html
void test02()
{
- bool test = true;
+ bool test __attribute__((unused)) = true;
std::string str01 = "twelve chars";
// str01 becomes shared
void test01()
{
// POD types : resize, capacity, reserve
- bool test = true;
+ bool test __attribute__((unused)) = true;
std::wstring str01;
typedef std::wstring::size_type size_type_s;
VERIFY( sz02 >= 100 );
str01.reserve();
sz01 = str01.capacity();
- VERIFY( sz01 >= 0 );
+ VERIFY( sz01 > 0 );
sz01 = str01.size() + 5;
str01.resize(sz01);
// trickster allocator issues involved with these:
std::wstring str3 = L"8-chars_8-chars_";
- const wchar_t* p3 = str3.c_str();
std::wstring str4 = str3 + L"7-chars";
- const wchar_t* p4 = str3.c_str();
sz01 = str01.size();
sz02 = str01.max_size();
// http://gcc.gnu.org/ml/libstdc++/2001-11/msg00150.html
void test02()
{
- bool test = true;
+ bool test __attribute__((unused)) = true;
std::wstring str01 = L"twelve chars";
// str01 becomes shared
void test01(void)
{
- bool test = true;
+ bool test __attribute__((unused)) = true;
typedef std::string::size_type csize_type;
typedef std::string::iterator citerator;
csize_type npos = std::string::npos;
- csize_type csz01, csz02;
+ csize_type csz01;
const char str_lit01[] = "rodeo beach, marin";
const std::string str01(str_lit01);
void test02()
{
- bool test = true;
+ bool test __attribute__((unused)) = true;
// template<typename _InputIter>
// basic_string(_InputIter begin, _InputIter end, const allocator& a)
void test03()
{
- bool test = true;
+ bool test __attribute__((unused)) = true;
const char* with_nulls = "This contains \0 a zero byte.";
// These are tests to see how basic_string handles data with NUL
// http://gcc.gnu.org/ml/libstdc++/2002-06/msg00025.html
void test04()
{
- bool test = true;
+ bool test __attribute__((unused)) = true;
std::string str01("portofino");
// libstdc++/8347
void test05()
{
- bool test = true;
+ bool test __attribute__((unused)) = true;
std::vector<char> empty;
std::string empty2(empty.begin(), empty.end());
void test01(void)
{
- bool test = true;
+ bool test __attribute__((unused)) = true;
typedef std::wstring::size_type csize_type;
typedef std::wstring::iterator citerator;
csize_type npos = std::wstring::npos;
- csize_type csz01, csz02;
+ csize_type csz01;
const wchar_t str_lit01[] = L"rodeo beach, marin";
const std::wstring str01(str_lit01);
void test02()
{
- bool test = true;
+ bool test __attribute__((unused)) = true;
// template<typename _InputIter>
// basic_string(_InputIter begin, _InputIter end, const allocator& a)
void test03()
{
- bool test = true;
+ bool test __attribute__((unused)) = true;
const wchar_t* with_nulls = L"This contains \0 a zero byte.";
// These are tests to see how basic_string handles data with NUL
// http://gcc.gnu.org/ml/libstdc++/2002-06/msg00025.html
void test04()
{
- bool test = true;
+ bool test __attribute__((unused)) = true;
std::wstring str01(L"portofino");
// libstdc++/8347
void test05()
{
- bool test = true;
+ bool test __attribute__((unused)) = true;
std::vector<wchar_t> empty;
std::wstring empty2(empty.begin(), empty.end());
bool test01(void)
{
- bool test = true;
+ bool test __attribute__((unused)) = true;
typedef std::string::size_type csize_type;
typedef std::string::const_reference cref;
typedef std::string::reference ref;
- csize_type npos = std::string::npos;
csize_type csz01, csz02;
const std::string str01("tamarindo, costa rica");
cref cref3 = str01.at(csz01 - 1);
VERIFY( cref3 == 'a' );
try {
- cref cref4 = str01.at(csz01);
+ str01.at(csz01);
VERIFY( false ); // Should not get here, as exception thrown.
}
catch(std::out_of_range& fail) {
ref ref3 = str02.at(csz02 - 1);
VERIFY( ref3 == 'a' );
try {
- ref ref4 = str02.at(csz02);
+ str02.at(csz02);
VERIFY( false ); // Should not get here, as exception thrown.
}
catch(std::out_of_range& fail) {
// underlying string implementation, of course.
bool test01(void)
{
- bool test = true;
+ bool test __attribute__((unused)) = true;
typedef std::string::size_type csize_type;
typedef std::string::iterator siterator;
typedef std::string::reverse_iterator sriterator;
- csize_type npos = std::string::npos;
csize_type csz01, csz02;
siterator it1;
sriterator rit1;
// iterators, namely insert and erase.
bool test02(void)
{
- bool test = true;
+ bool test __attribute__((unused)) = true;
typedef std::string::size_type csize_type;
typedef std::string::iterator siterator;
typedef std::string::reverse_iterator sriterator;
- csize_type npos = std::string::npos;
- csize_type csz01, csz02;
siterator it1;
sriterator rit1;
bool test01(void)
{
- bool test = true;
+ bool test __attribute__((unused)) = true;
typedef std::wstring::size_type csize_type;
typedef std::wstring::const_reference cref;
typedef std::wstring::reference ref;
- csize_type npos = std::wstring::npos;
csize_type csz01, csz02;
const std::wstring str01(L"tamarindo, costa rica");
cref cref3 = str01.at(csz01 - 1);
VERIFY( cref3 == L'a' );
try {
- cref cref4 = str01.at(csz01);
+ str01.at(csz01);
VERIFY( false ); // Should not get here, as exception thrown.
}
catch(std::out_of_range& fail) {
ref ref3 = str02.at(csz02 - 1);
VERIFY( ref3 == L'a' );
try {
- ref ref4 = str02.at(csz02);
+ str02.at(csz02);
VERIFY( false ); // Should not get here, as exception thrown.
}
catch(std::out_of_range& fail) {
// underlying string implementation, of course.
bool test01(void)
{
- bool test = true;
+ bool test __attribute__((unused)) = true;
typedef std::wstring::size_type csize_type;
typedef std::wstring::iterator siterator;
typedef std::wstring::reverse_iterator sriterator;
- csize_type npos = std::wstring::npos;
csize_type csz01, csz02;
siterator it1;
sriterator rit1;
// iterators, namely insert and erase.
bool test02(void)
{
- bool test = true;
+ bool test __attribute__((unused)) = true;
typedef std::wstring::size_type csize_type;
typedef std::wstring::iterator siterator;
typedef std::wstring::reverse_iterator sriterator;
- csize_type npos = std::wstring::npos;
- csize_type csz01, csz02;
siterator it1;
sriterator rit1;
bool test01(void)
{
- bool test = true;
+ bool test __attribute__((unused)) = true;
typedef std::string::size_type csize_type;
typedef std::string::const_reference cref;
typedef std::string::reference ref;
bool test02(void)
{
- bool test = true;
+ bool test __attribute__((unused)) = true;
typedef std::string::size_type csize_type;
csize_type npos = std::string::npos;
csize_type csz01, csz02;
bool test03(void)
{
- bool test = true;
+ bool test __attribute__((unused)) = true;
typedef std::string::size_type csize_type;
csize_type npos = std::string::npos;
csize_type csz01;
bool test01(void)
{
- bool test = true;
+ bool test __attribute__((unused)) = true;
typedef std::wstring::size_type csize_type;
typedef std::wstring::const_reference cref;
typedef std::wstring::reference ref;
bool test02(void)
{
- bool test = true;
+ bool test __attribute__((unused)) = true;
typedef std::wstring::size_type csize_type;
csize_type npos = std::wstring::npos;
csize_type csz01, csz02;
bool test03(void)
{
- bool test = true;
+ bool test __attribute__((unused)) = true;
typedef std::wstring::size_type csize_type;
csize_type npos = std::wstring::npos;
csize_type csz01;
int test01(void)
{
- bool test = true;
+ bool test __attribute__((unused)) = true;
typedef std::string::size_type csize_type;
typedef std::string::iterator citerator;
- csize_type npos = std::string::npos;
csize_type csz01, csz02;
const std::string str01("rodeo beach, marin");
// but now s points inside the _Rep
int test02(void)
{
- bool test = true;
+ bool test __attribute__((unused)) = true;
std::string str01;
const char* title = "Everything was beautiful, and nothing hurt";
int test01(void)
{
- bool test = true;
+ bool test __attribute__((unused)) = true;
typedef std::wstring::size_type csize_type;
typedef std::wstring::iterator citerator;
- csize_type npos = std::wstring::npos;
csize_type csz01, csz02;
const std::wstring str01(L"rodeo beach, marin");
// but now s points inside the _Rep
int test02(void)
{
- bool test = true;
+ bool test __attribute__((unused)) = true;
std::wstring str01;
const wchar_t* title = L"Everything was beautiful, and nothing hurt";
bool test01(void)
{
- bool test = true;
+ bool test __attribute__((unused)) = true;
typedef std::string::size_type csize_type;
typedef std::string::const_reference cref;
typedef std::string::reference ref;
- csize_type npos = std::string::npos;
- csize_type csz01, csz02;
const std::string str01("sailing grand traverse bay\n"
"\t\t\t from Elk Rapids to the point reminds me of miles");
// testing basic_stringbuf::xsputn via stress testing with large strings
// based on a bug report libstdc++ 9
-void test04(int size)
+void test04(std::size_t size)
{
- bool test = true;
+ bool test __attribute__((unused)) = true;
std::string str(size, 's');
- int expected_size = 2 * (size + 1);
+ std::size_t expected_size = 2 * (size + 1);
std::ostringstream oss(str);
// sanity checks
// testing basic_filebuf::xsputn via stress testing with large strings
// based on a bug report libstdc++ 9
// mode == out
-void test05(int size)
+void test05(std::size_t size)
{
- bool test = true;
+ bool test __attribute__((unused)) = true;
const char filename[] = "inserters_extractors-1.txt";
const char fillc = 'f';
std::ofstream ofs(filename);
// sanity check on the written file
std::ifstream ifs(filename);
- int count = 0;
+ std::size_t count = 0;
char c;
while (count <= (2 * size) + 4)
{
// http://gcc.gnu.org/ml/libstdc++/1999-q4/msg00049.html
void test06(void)
{
- bool test = true;
+ bool test __attribute__((unused)) = true;
typedef std::string::size_type size_type;
std::string str01("@silent");
// NB: this is a defect in the standard.
void test07(void)
{
- bool test = true;
+ bool test __attribute__((unused)) = true;
const std::string name("z6.cc");
std::istringstream iss (name);
int i = 0;
{
using namespace std;
- bool test = true;
+ bool test __attribute__((unused)) = true;
istringstream istrm("enero:2001");
int year;
char sep;
// libstdc++/2830
void test09()
{
- bool test = true;
+ bool test __attribute__((unused)) = true;
std::string blanks( 3, '\0');
std::string foo = "peace";
foo += blanks;
bool test01(void)
{
- bool test = true;
+ bool test __attribute__((unused)) = true;
typedef std::wstring::size_type csize_type;
typedef std::wstring::const_reference cref;
typedef std::wstring::reference ref;
- csize_type npos = std::wstring::npos;
- csize_type csz01, csz02;
const std::wstring str01(L"sailing grand traverse bay\n"
L"\t\t\t from Elk Rapids to the point reminds me of miles");
// testing basic_stringbuf::xsputn via stress testing with large strings
// based on a bug report libstdc++ 9
-void test04(int size)
+void test04(std::size_t size)
{
- bool test = true;
+ bool test __attribute__((unused)) = true;
std::wstring str(size, L's');
- int expected_size = 2 * (size + 1);
+ std::size_t expected_size = 2 * (size + 1);
std::wostringstream oss(str);
// sanity checks
// testing basic_filebuf::xsputn via stress testing with large strings
// based on a bug report libstdc++ 9
// mode == out
-void test05(int size)
+void test05(std::size_t size)
{
- bool test = true;
+ bool test __attribute__((unused)) = true;
const char filename[] = "inserters_extractors-1.txt";
const wchar_t fillc = L'f';
std::wofstream ofs(filename);
// sanity check on the written file
std::wifstream ifs(filename);
- int count = 0;
+ std::size_t count = 0;
wchar_t c;
while (count <= (2 * size) + 4)
{
// http://gcc.gnu.org/ml/libstdc++/1999-q4/msg00049.html
void test06(void)
{
- bool test = true;
+ bool test __attribute__((unused)) = true;
typedef std::wstring::size_type size_type;
std::wstring str01(L"@silent");
// NB: this is a defect in the standard.
void test07(void)
{
- bool test = true;
+ bool test __attribute__((unused)) = true;
const std::wstring name(L"z6.cc");
std::wistringstream iss(name);
int i = 0;
{
using namespace std;
- bool test = true;
+ bool test __attribute__((unused)) = true;
wistringstream istrm(L"enero:2001");
int year;
wchar_t sep;
// libstdc++/2830
void test09()
{
- bool test = true;
+ bool test __attribute__((unused)) = true;
std::wstring blanks(3, L'\0');
std::wstring foo = L"peace";
foo += blanks;
int test01(void)
{
- bool test = true;
+ bool test __attribute__((unused)) = true;
std::string str1;
std::string str2;
// 1:8-chars_8-chars_
// 2:8-chars_8-chars_
str1 = std::string("8-chars_") + "8-chars_";
- const char* p1 = str1.c_str();
+ str1.c_str();
// printf("1:%s\n", str1.c_str());
str2 = str1 + "7-chars";
// printf("2:%s\n", str1.c_str()); //str1 is gone
- const char* p2 = str1.c_str();
+ str1.c_str();
return 0;
}
int test01(void)
{
- bool test = true;
+ bool test __attribute__((unused)) = true;
std::string str_0("costa rica");
std::string str_1("costa marbella");
std::string str_2("cost");
int test01(void)
{
- bool test = true;
+ bool test __attribute__((unused)) = true;
std::wstring str1;
std::wstring str2;
// 1:8-chars_8-chars_
// 2:8-chars_8-chars_
str1 = std::wstring(L"8-chars_") + L"8-chars_";
- const wchar_t* p1 = str1.c_str();
+ str1.c_str();
// wprintf("1:%s\n", str1.c_str());
str2 = str1 + L"7-chars";
// wprintf("2:%s\n", str1.c_str()); //str1 is gone
- const wchar_t* p2 = str1.c_str();
+ str1.c_str();
return 0;
}
int test01(void)
{
- bool test = true;
+ bool test __attribute__((unused)) = true;
std::wstring str_0(L"costa rica");
std::wstring str_1(L"costa marbella");
std::wstring str_2(L"cost");
bool test01(void)
{
- bool test = true;
+ bool test __attribute__((unused)) = true;
typedef std::string::size_type csize_type;
typedef std::string::const_reference cref;
typedef std::string::reference ref;
- csize_type npos = std::string::npos;
- csize_type csz01, csz02;
const char str_lit01[] = "ventura, california";
const std::string str01(str_lit01);
void
test02()
{
- bool test = true;
+ bool test __attribute__((unused)) = true;
const char* strlit = "../the long pier/Hanalei Bay/Kauai/Hawaii";
std::string aux = strlit;
aux.replace(aux.begin()+5, aux.begin()+20,
void
test03()
{
- bool test = true;
+ bool test __attribute__((unused)) = true;
const char* title01 = "nine types of ambiguity";
const char* title02 = "ultra";
std::string str01 = title01;
void
test04()
{
- bool test = true;
+ bool test __attribute__((unused)) = true;
std::string str01 = "geogaddi";
std::string str02;
void
test05()
{
- bool test = true;
+ bool test __attribute__((unused)) = true;
std::string str01 = "londinium";
std::string str02 = "cydonia";
bool test01(void)
{
- bool test = true;
+ bool test __attribute__((unused)) = true;
typedef std::wstring::size_type csize_type;
typedef std::wstring::const_reference cref;
typedef std::wstring::reference ref;
- csize_type npos = std::wstring::npos;
- csize_type csz01, csz02;
const wchar_t str_lit01[] = L"ventura, california";
const std::wstring str01(str_lit01);
void
test02()
{
- bool test = true;
+ bool test __attribute__((unused)) = true;
const wchar_t* strlit = L"../the long pier/Hanalei Bay/Kauai/Hawaii";
std::wstring aux = strlit;
aux.replace(aux.begin()+5, aux.begin()+20,
void
test03()
{
- bool test = true;
+ bool test __attribute__((unused)) = true;
const wchar_t* title01 = L"nine types of ambiguity";
const wchar_t* title02 = L"ultra";
std::wstring str01 = title01;
void
test04()
{
- bool test = true;
+ bool test __attribute__((unused)) = true;
std::wstring str01 = L"geogaddi";
std::wstring str02;
void
test05()
{
- bool test = true;
+ bool test __attribute__((unused)) = true;
std::wstring str01 = L"londinium";
std::wstring str02 = L"cydonia";
// 21.3.6.2 basic_string rfind
bool test01(void)
{
- bool test = true;
+ bool test __attribute__((unused)) = true;
typedef std::string::size_type csize_type;
typedef std::string::const_reference cref;
typedef std::string::reference ref;
// 21.3.6.4 basic_string::find_last_of
bool test02()
{
- bool test = true;
+ bool test __attribute__((unused)) = true;
std::string z("ab");
std::string::size_type pos;
pos = z.find_last_of("ab");
// 21.3.6.6 basic_string::find_last_not_of
bool test03()
{
- bool test = true;
+ bool test __attribute__((unused)) = true;
typedef std::string::size_type csize_type;
std::string::size_type pos;
csize_type npos = std::string::npos;
// 21.3.6.2 basic_string rfind
bool test01(void)
{
- bool test = true;
+ bool test __attribute__((unused)) = true;
typedef std::wstring::size_type csize_type;
typedef std::wstring::const_reference cref;
typedef std::wstring::reference ref;
// 21.3.6.4 basic_string::find_last_of
bool test02()
{
- bool test = true;
+ bool test __attribute__((unused)) = true;
std::wstring::size_type pos;
std::wstring z(L"ab");
pos = z.find_last_of(L"ab");
// 21.3.6.6 basic_string::find_last_not_of
bool test03()
{
- bool test = true;
+ bool test __attribute__((unused)) = true;
typedef std::wstring::size_type csize_type;
std::wstring::size_type pos;
csize_type npos = std::wstring::npos;
bool test01(void)
{
- bool test = true;
+ bool test __attribute__((unused)) = true;
typedef std::string::size_type csize_type;
typedef std::string::const_reference cref;
typedef std::string::reference ref;
- csize_type npos = std::string::npos;
- csize_type csz01, csz02;
+ csize_type csz01;
const char str_lit01[] = "rockaway, pacifica";
const std::string str01(str_lit01);
bool test01(void)
{
- bool test = true;
+ bool test __attribute__((unused)) = true;
typedef std::wstring::size_type csize_type;
typedef std::wstring::const_reference cref;
typedef std::wstring::reference ref;
- csize_type npos = std::wstring::npos;
- csize_type csz01, csz02;
+ csize_type csz01;
const wchar_t str_lit01[] = L"rockaway, pacifica";
const std::wstring str01(str_lit01);
void test01()
{
- bool test = true;
+ bool test __attribute__((unused)) = true;
char c = 'a';
const char cc = 'b';
char* c1 = &c;
const char* ccarray2 = "san francisco sunny-day park inspectors";
char carray[50];
strcpy(carray, ccarray1);
- void* v = carray;
const void* cv = ccarray1;
-
- memchr(cv, '/', 3);
- strchr(ccarray1, '/');
- strpbrk(ccarray1, ccarray2);
- strrchr(ccarray1, 'c');
- strstr(carray, carray);
+ void* v;
+ char* c;
+
+ v = memchr(cv, '/', 3);
+ c = strchr(ccarray1, '/');
+ c = strrchr(ccarray1, 'c');
+ c = strpbrk(ccarray1, ccarray2);
+ c = strstr(carray, carray);
}
int main()