Commit 4ba851b5 by Paolo Carlini Committed by Paolo Carlini

PR libstdc++/28080 (partial)

2007-03-06  Paolo Carlini  <pcarlini@suse.de>

	PR libstdc++/28080 (partial)
	* include/bits/stl_algobase.h: Do not include <cstdlib>.
	* src/localename.cc: Do it here.
	* src/ctype.cc: Likewise.
	* include/ext/pb_ds/detail/map_debug_base.hpp: Likewise.
	* include/ext/pb_ds/exception.hpp: Likewise.
	* include/ext/pb_ds/list_update_policy.hpp: Likewise.
	* include/bits/stl_algo.h: Likewise.
	* include/tr1/random: Likewise.
	* testsuite/util/testsuite_hooks.cc: Likewise.
	* testsuite/util/testsuite_abi_check.cc: Likewise.
	* testsuite/util/testsuite_abi.cc: Likewise.
	* testsuite/util/performance/assoc/timing/
	tree_order_statistics_test.hpp: Likewise.
	* config/locale/darwin/ctype_members.cc: Likewise.
	* config/locale/gnu/c++locale_internal.h: Likewise.
	* config/locale/generic/ctype_members.cc: Likewise.
	* config/locale/generic/time_members.cc: Likewise.

	* include/ext/pb_ds/detail/resize_policy/
	hash_load_check_resize_trigger_imp.hpp: Qualify abort.
	* testsuite/util/performance/assoc/timing/
	multimap_find_test.hpp: Likewise.
	* include/std/valarray: Do include <cstdlib>.
	* include/tr1/hashtable: Likewise.

From-SVN: r122628
parent 25108646
2007-03-06 Paolo Carlini <pcarlini@suse.de>
PR libstdc++/28080 (partial)
* include/bits/stl_algobase.h: Do not include <cstdlib>.
* src/localename.cc: Do it here.
* src/ctype.cc: Likewise.
* include/ext/pb_ds/detail/map_debug_base.hpp: Likewise.
* include/ext/pb_ds/exception.hpp: Likewise.
* include/ext/pb_ds/list_update_policy.hpp: Likewise.
* include/bits/stl_algo.h: Likewise.
* include/tr1/random: Likewise.
* testsuite/util/testsuite_hooks.cc: Likewise.
* testsuite/util/testsuite_abi_check.cc: Likewise.
* testsuite/util/testsuite_abi.cc: Likewise.
* testsuite/util/performance/assoc/timing/
tree_order_statistics_test.hpp: Likewise.
* config/locale/darwin/ctype_members.cc: Likewise.
* config/locale/gnu/c++locale_internal.h: Likewise.
* config/locale/generic/ctype_members.cc: Likewise.
* config/locale/generic/time_members.cc: Likewise.
* include/ext/pb_ds/detail/resize_policy/
hash_load_check_resize_trigger_imp.hpp: Qualify abort.
* testsuite/util/performance/assoc/timing/
multimap_find_test.hpp: Likewise.
* include/std/valarray: Do include <cstdlib>.
* include/tr1/hashtable: Likewise.
2007-03-05 Joseph Myers <joseph@codesourcery.com> 2007-03-05 Joseph Myers <joseph@codesourcery.com>
PR libstdc++/30675 PR libstdc++/30675
......
...@@ -36,6 +36,7 @@ ...@@ -36,6 +36,7 @@
#include <locale> #include <locale>
#include <bits/c++locale_internal.h> #include <bits/c++locale_internal.h>
#include <cstdlib>
namespace std namespace std
{ {
......
...@@ -35,6 +35,7 @@ ...@@ -35,6 +35,7 @@
// Written by Benjamin Kosnik <bkoz@redhat.com> // Written by Benjamin Kosnik <bkoz@redhat.com>
#include <locale> #include <locale>
#include <cstdlib>
_GLIBCXX_BEGIN_NAMESPACE(std) _GLIBCXX_BEGIN_NAMESPACE(std)
......
// std::time_get, std::time_put implementation, generic version -*- C++ -*- // std::time_get, std::time_put implementation, generic version -*- C++ -*-
// Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. // Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007
// Free Software Foundation, Inc.
// //
// This file is part of the GNU ISO C++ Library. This library is free // 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 // software; you can redistribute it and/or modify it under the
...@@ -35,6 +36,7 @@ ...@@ -35,6 +36,7 @@
// Written by Benjamin Kosnik <bkoz@redhat.com> // Written by Benjamin Kosnik <bkoz@redhat.com>
#include <locale> #include <locale>
#include <cstdlib>
_GLIBCXX_BEGIN_NAMESPACE(std) _GLIBCXX_BEGIN_NAMESPACE(std)
......
// Prototypes for GLIBC thread locale __-prefixed functions -*- C++ -*- // Prototypes for GLIBC thread locale __-prefixed functions -*- C++ -*-
// Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc. // Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007
// Free Software Foundation, Inc.
// //
// This file is part of the GNU ISO C++ Library. This library is free // 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 // software; you can redistribute it and/or modify it under the
...@@ -36,6 +37,7 @@ ...@@ -36,6 +37,7 @@
#include <bits/c++config.h> #include <bits/c++config.h>
#include <clocale> #include <clocale>
#include <cstdlib>
#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2) #if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2)
......
// Algorithm implementation -*- C++ -*- // Algorithm implementation -*- C++ -*-
// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006 // Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007
// Free Software Foundation, Inc. // Free Software Foundation, Inc.
// //
// This file is part of the GNU ISO C++ Library. This library is free // This file is part of the GNU ISO C++ Library. This library is free
...@@ -64,6 +64,7 @@ ...@@ -64,6 +64,7 @@
#include <bits/stl_heap.h> #include <bits/stl_heap.h>
#include <bits/stl_tempbuf.h> // for _Temporary_buffer #include <bits/stl_tempbuf.h> // for _Temporary_buffer
#include <cstdlib> // for rand
#include <debug/debug.h> #include <debug/debug.h>
// See concept_check.h for the __glibcxx_*_requires macros. // See concept_check.h for the __glibcxx_*_requires macros.
......
...@@ -65,7 +65,6 @@ ...@@ -65,7 +65,6 @@
#include <bits/c++config.h> #include <bits/c++config.h>
#include <cstring> #include <cstring>
#include <cwchar> #include <cwchar>
#include <cstdlib>
#include <cstddef> #include <cstddef>
#include <bits/functexcept.h> #include <bits/functexcept.h>
#include <bits/stl_pair.h> #include <bits/stl_pair.h>
......
// -*- C++ -*- // -*- C++ -*-
// Copyright (C) 2005, 2006 Free Software Foundation, Inc. // Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc.
// //
// This file is part of the GNU ISO C++ Library. This library is free // 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 // software; you can redistribute it and/or modify it under the terms
...@@ -51,6 +51,7 @@ ...@@ -51,6 +51,7 @@
#include <list> #include <list>
#include <utility> #include <utility>
#include <cstdlib>
#include <ext/throw_allocator.h> #include <ext/throw_allocator.h>
#include <debug/debug.h> #include <debug/debug.h>
...@@ -157,7 +158,7 @@ namespace pb_ds ...@@ -157,7 +158,7 @@ namespace pb_ds
if (find(r_key) != m_key_set.end()) if (find(r_key) != m_key_set.end())
{ {
std::cerr << "insert_new " << r_key << std::endl; std::cerr << "insert_new " << r_key << std::endl;
abort(); std::abort();
} }
try try
...@@ -167,7 +168,7 @@ namespace pb_ds ...@@ -167,7 +168,7 @@ namespace pb_ds
catch(...) catch(...)
{ {
std::cerr << "insert_new 1" << r_key << std::endl; std::cerr << "insert_new 1" << r_key << std::endl;
abort(); std::abort();
} }
alloc.set_throw_prob(orig_throw_prob); alloc.set_throw_prob(orig_throw_prob);
_GLIBCXX_DEBUG_ONLY(assert_valid();) _GLIBCXX_DEBUG_ONLY(assert_valid();)
...@@ -183,7 +184,7 @@ namespace pb_ds ...@@ -183,7 +184,7 @@ namespace pb_ds
if (it == m_key_set.end()) if (it == m_key_set.end())
{ {
std::cerr << "erase_existing " << r_key << std::endl; std::cerr << "erase_existing " << r_key << std::endl;
abort(); std::abort();
} }
m_key_set.erase(it); m_key_set.erase(it);
_GLIBCXX_DEBUG_ONLY(assert_valid();) _GLIBCXX_DEBUG_ONLY(assert_valid();)
...@@ -208,7 +209,7 @@ namespace pb_ds ...@@ -208,7 +209,7 @@ namespace pb_ds
if (find(r_key) == m_key_set.end()) if (find(r_key) == m_key_set.end())
{ {
std::cerr << "check_key_exists " << r_key << std::endl; std::cerr << "check_key_exists " << r_key << std::endl;
abort(); std::abort();
} }
_GLIBCXX_DEBUG_ONLY(assert_valid();) _GLIBCXX_DEBUG_ONLY(assert_valid();)
} }
...@@ -222,7 +223,7 @@ namespace pb_ds ...@@ -222,7 +223,7 @@ namespace pb_ds
if (find(r_key) != m_key_set.end()) if (find(r_key) != m_key_set.end())
{ {
std::cerr << "check_key_does_not_exist " << r_key << std::endl; std::cerr << "check_key_does_not_exist " << r_key << std::endl;
abort(); std::abort();
} }
} }
...@@ -237,7 +238,7 @@ namespace pb_ds ...@@ -237,7 +238,7 @@ namespace pb_ds
{ {
std::cerr << "check_size " << size std::cerr << "check_size " << size
<< " " << key_set_size << std::endl; << " " << key_set_size << std::endl;
abort(); std::abort();
} }
_GLIBCXX_DEBUG_ONLY(assert_valid();) _GLIBCXX_DEBUG_ONLY(assert_valid();)
} }
......
...@@ -280,7 +280,7 @@ PB_DS_CLASS_T_DEC ...@@ -280,7 +280,7 @@ PB_DS_CLASS_T_DEC
void void
PB_DS_CLASS_C_DEC:: PB_DS_CLASS_C_DEC::
do_resize(size_type) do_resize(size_type)
{ abort(); } { std::abort(); }
#ifdef _GLIBCXX_DEBUG #ifdef _GLIBCXX_DEBUG
PB_DS_CLASS_T_DEC PB_DS_CLASS_T_DEC
......
// -*- C++ -*- // -*- C++ -*-
// Copyright (C) 2005, 2006 Free Software Foundation, Inc. // Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc.
// //
// This file is part of the GNU ISO C++ Library. This library is free // 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 // software; you can redistribute it and/or modify it under the terms
...@@ -48,6 +48,7 @@ ...@@ -48,6 +48,7 @@
#define PB_DS_EXCEPTION_HPP #define PB_DS_EXCEPTION_HPP
#include <stdexcept> #include <stdexcept>
#include <cstdlib>
namespace pb_ds namespace pb_ds
{ {
......
// -*- C++ -*- // -*- C++ -*-
// Copyright (C) 2005, 2006 Free Software Foundation, Inc. // Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc.
// //
// This file is part of the GNU ISO C++ Library. This library is free // 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 // software; you can redistribute it and/or modify it under the terms
...@@ -47,6 +47,7 @@ ...@@ -47,6 +47,7 @@
#ifndef PB_DS_LU_POLICY_HPP #ifndef PB_DS_LU_POLICY_HPP
#define PB_DS_LU_POLICY_HPP #define PB_DS_LU_POLICY_HPP
#include <cstdlib>
#include <ext/pb_ds/detail/list_update_policy/counter_lu_metadata.hpp> #include <ext/pb_ds/detail/list_update_policy/counter_lu_metadata.hpp>
namespace pb_ds namespace pb_ds
......
...@@ -43,7 +43,6 @@ ...@@ -43,7 +43,6 @@
#include <bits/c++config.h> #include <bits/c++config.h>
#include <cstddef> #include <cstddef>
#include <cmath> #include <cmath>
#include <cstdlib>
#include <algorithm> #include <algorithm>
#include <debug/debug.h> #include <debug/debug.h>
......
...@@ -56,7 +56,6 @@ ...@@ -56,7 +56,6 @@
#include <memory> #include <memory>
#include <iterator> #include <iterator>
#include <cstddef> #include <cstddef>
#include <cstdlib>
#include <cmath> #include <cmath>
#include <bits/functexcept.h> #include <bits/functexcept.h>
#include <tr1/type_traits> // For true_type and false_type #include <tr1/type_traits> // For true_type and false_type
......
...@@ -37,6 +37,7 @@ ...@@ -37,6 +37,7 @@
#include <cmath> #include <cmath>
#include <cstdio> #include <cstdio>
#include <cstdlib>
#include <string> #include <string>
#include <iosfwd> #include <iosfwd>
#include <limits> #include <limits>
......
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
// the GNU General Public License. // the GNU General Public License.
#include <locale> #include <locale>
#include <cstdlib>
_GLIBCXX_BEGIN_NAMESPACE(std) _GLIBCXX_BEGIN_NAMESPACE(std)
...@@ -74,7 +75,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) ...@@ -74,7 +75,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
// XXX At some point, just rename this file to ctype_configure_char.cc // XXX At some point, just rename this file to ctype_configure_char.cc
// and compile it as a separate file instead of including it here. // and compile it as a separate file instead of including it here.
// Platform-specific initialization code for ctype tables. // Platform-specific initialization code for ctype tables.
#include <bits/ctype_noninline.h> #include <bits/ctype_noninline.h>
const size_t ctype<char>::table_size; const size_t ctype<char>::table_size;
......
// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 // Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
// 2006, 2007
// Free Software Foundation, Inc. // Free Software Foundation, Inc.
// //
// This file is part of the GNU ISO C++ Library. This library is free // This file is part of the GNU ISO C++ Library. This library is free
...@@ -28,6 +29,7 @@ ...@@ -28,6 +29,7 @@
#include <clocale> #include <clocale>
#include <cstring> #include <cstring>
#include <cstdlib>
#include <locale> #include <locale>
_GLIBCXX_BEGIN_NAMESPACE(std) _GLIBCXX_BEGIN_NAMESPACE(std)
......
// -*- C++ -*- // -*- C++ -*-
// Copyright (C) 2005, 2006 Free Software Foundation, Inc. // Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc.
// //
// This file is part of the GNU ISO C++ Library. This library is free // 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 // software; you can redistribute it and/or modify it under the terms
...@@ -84,7 +84,7 @@ namespace pb_ds ...@@ -84,7 +84,7 @@ namespace pb_ds
} }
if (not_found_count != 0) if (not_found_count != 0)
abort(); std::abort();
} }
private: private:
...@@ -116,7 +116,7 @@ namespace pb_ds ...@@ -116,7 +116,7 @@ namespace pb_ds
} }
if (not_found_count != 0) if (not_found_count != 0)
abort(); std::abort();
} }
private: private:
......
...@@ -52,6 +52,7 @@ ...@@ -52,6 +52,7 @@
#include <common_type/assoc/string_form.hpp> #include <common_type/assoc/string_form.hpp>
#include <ext/pb_ds/detail/type_utils.hpp> #include <ext/pb_ds/detail/type_utils.hpp>
#include <iterator> #include <iterator>
#include <cstdlib>
namespace pb_ds namespace pb_ds
{ {
...@@ -84,7 +85,7 @@ namespace pb_ds ...@@ -84,7 +85,7 @@ namespace pb_ds
const size_t max_size = m_r_container.size(); const size_t max_size = m_r_container.size();
while (it != e) while (it != e)
if (m_r_container.order_of_key(*(it++)) > max_size) if (m_r_container.order_of_key(*(it++)) > max_size)
abort(); std::abort();
} }
} }
...@@ -113,7 +114,7 @@ namespace pb_ds ...@@ -113,7 +114,7 @@ namespace pb_ds
{ {
const_iterator f_it = m_r_container.find(*(it++)); const_iterator f_it = m_r_container.find(*(it++));
if (static_cast<size_t>(std::distance(b, f_it)) > max_size) if (static_cast<size_t>(std::distance(b, f_it)) > max_size)
abort(); std::abort();
} }
} }
} }
......
...@@ -33,6 +33,7 @@ ...@@ -33,6 +33,7 @@
#include <sstream> #include <sstream>
#include <fstream> #include <fstream>
#include <iostream> #include <iostream>
#include <cstdlib>
using namespace std; using namespace std;
......
// -*- C++ -*- // -*- C++ -*-
// Copyright (C) 2004 Free Software Foundation, Inc. // Copyright (C) 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
// This library is free software; you can redistribute it and/or // This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License as // modify it under the terms of the GNU General Public License as
...@@ -33,6 +33,7 @@ ...@@ -33,6 +33,7 @@
#include "testsuite_abi.h" #include "testsuite_abi.h"
#include <iostream> #include <iostream>
#include <cstdlib>
#include <unistd.h> // for access(2) #include <unistd.h> // for access(2)
int int
......
...@@ -43,6 +43,7 @@ ...@@ -43,6 +43,7 @@
#include <stdexcept> #include <stdexcept>
#include <cstddef> #include <cstddef>
#include <clocale> #include <clocale>
#include <cstdlib>
#include <locale> #include <locale>
#include <cxxabi.h> #include <cxxabi.h>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment