Commit 6b76f569 by Benjamin Kosnik

[multiple changes]


2000-10-21  Benjamin Kosnik  <bkoz@purist.soma.redhat.com>

	* docs/links.html: Add links to defects list, standards FAQ.

	* testsuite/21_strings/ctor_copy_dtor.cc (test01): Disable tests
	with string creation that allocate huge ammounts of memory.

	* include/c/bits/std_cstddef.h: Put size_t, ptrdiff_t in
	namepace std.

2000-10-21  Theodore Papadopoulo <Theodore.Papadopoulo@sophia.inria.fr>

    	* libsupc++/exception.cc: Use namespace std.
    	* libsupc++/new: DITTO.
    	* libsupc++/new_op.cc: DITTO.
    	* libsupc++/new_opnt.cc: DITTO.
    	* libsupc++/new_opv.cc: DITTO.
    	* libsupc++/new_opvnt.cc: DITTO.
    	* libsupc++/tinfo.cc: DITTO.
    	* libsupc++/tinfo.h: DITTO.
    	* libsupc++/vec.cc: DITTO.
    	* libsupc++/Makefile.am: Blank lines removal.

From-SVN: r36995
parent 80393943
2000-10-21 Benjamin Kosnik <bkoz@purist.soma.redhat.com>
* docs/links.html: Add links to defects list, standards FAQ.
* testsuite/21_strings/ctor_copy_dtor.cc (test01): Disable tests
with string creation that allocate huge ammounts of memory.
* include/c/bits/std_cstddef.h: Put size_t, ptrdiff_t in
namepace std.
2000-10-21 Theodore Papadopoulo <Theodore.Papadopoulo@sophia.inria.fr>
* libsupc++/exception.cc: Use namespace std.
* libsupc++/new: DITTO.
* libsupc++/new_op.cc: DITTO.
* libsupc++/new_opnt.cc: DITTO.
* libsupc++/new_opv.cc: DITTO.
* libsupc++/new_opvnt.cc: DITTO.
* libsupc++/tinfo.cc: DITTO.
* libsupc++/tinfo.h: DITTO.
* libsupc++/vec.cc: DITTO.
* libsupc++/Makefile.am: Blank lines removal.
2000-10-21 Joseph S. Myers <jsm28@cam.ac.uk> 2000-10-21 Joseph S. Myers <jsm28@cam.ac.uk>
* docs/configopts.html, docs/install.html, docs/17_intro/BADNAMES, * docs/configopts.html, docs/install.html, docs/17_intro/BADNAMES,
......
...@@ -5,6 +5,13 @@ ...@@ -5,6 +5,13 @@
<H3>Links</H3> <H3>Links</H3>
Public websites that have info on known defects in the standard:
<P><UL>
<LI><A HREF="http://www.dkuug.dk/jtc1/sc22/wg21/">defect reflector</A>
<LI><A HREF="http://www.comeaucomputing.com/iso/">comeau reflector</A>
<LI><A HREF="http://reality.sgi.com/austern_mti/std-c++/faq.html">c++ standards FAQ</A>
</UL></P>
<P><UL> <P><UL>
<LI><A HREF="http://www.sgi.com/Technology/STL">The SGI STL page</A> <LI><A HREF="http://www.sgi.com/Technology/STL">The SGI STL page</A>
<LI><A HREF="http://www.stlport.org/">STLport homepage</A> <LI><A HREF="http://www.stlport.org/">STLport homepage</A>
......
...@@ -38,3 +38,10 @@ ...@@ -38,3 +38,10 @@
# pragma GCC system_header # pragma GCC system_header
# include_next <stddef.h> # include_next <stddef.h>
#endif #endif
namespace std {
using ::size_t;
using ::ptrdiff_t;
} // namespace std
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
#include "typeinfo" #include "typeinfo"
#include "exception" #include "exception"
#include <stddef.h> #include <cstddef>
#include "gansidecl.h" /* Needed to support macros used in eh-common.h. */ #include "gansidecl.h" /* Needed to support macros used in eh-common.h. */
#include "eh-common.h" #include "eh-common.h"
...@@ -119,7 +119,7 @@ struct cp_eh_info ...@@ -119,7 +119,7 @@ struct cp_eh_info
extern "C" cp_eh_info **__get_eh_info (); // actually void ** extern "C" cp_eh_info **__get_eh_info (); // actually void **
/* Exception allocate and free, defined in libgcc2. */ /* Exception allocate and free, defined in libgcc2. */
extern "C" void *__eh_alloc(size_t); extern "C" void *__eh_alloc(std::size_t);
extern "C" void __eh_free(void *); extern "C" void __eh_free(void *);
/* Is P the type_info node for a pointer of some kind? */ /* Is P the type_info node for a pointer of some kind? */
......
...@@ -32,7 +32,6 @@ ...@@ -32,7 +32,6 @@
#pragma interface "new" #pragma interface "new"
#include <cstddef> #include <cstddef>
//#include <stddef.h>
#include <exception> #include <exception>
extern "C++" { extern "C++" {
...@@ -52,18 +51,18 @@ namespace std { ...@@ -52,18 +51,18 @@ namespace std {
} // namespace std } // namespace std
// replaceable signatures // replaceable signatures
void *operator new (size_t) throw (std::bad_alloc); void *operator new (std::size_t) throw (std::bad_alloc);
void *operator new[] (size_t) throw (std::bad_alloc); void *operator new[] (std::size_t) throw (std::bad_alloc);
void operator delete (void *) throw(); void operator delete (void *) throw();
void operator delete[] (void *) throw(); void operator delete[] (void *) throw();
void *operator new (size_t, const std::nothrow_t&) throw(); void *operator new (std::size_t, const std::nothrow_t&) throw();
void *operator new[] (size_t, const std::nothrow_t&) throw(); void *operator new[] (std::size_t, const std::nothrow_t&) throw();
void operator delete (void *, const std::nothrow_t&) throw(); void operator delete (void *, const std::nothrow_t&) throw();
void operator delete[] (void *, const std::nothrow_t&) throw(); void operator delete[] (void *, const std::nothrow_t&) throw();
// default placement versions of operator new // default placement versions of operator new
inline void *operator new(size_t, void *place) throw() { return place; } inline void *operator new(std::size_t, void *place) throw() { return place; }
inline void *operator new[](size_t, void *place) throw() { return place; } inline void *operator new[](std::size_t, void *place) throw() { return place; }
} // extern "C++" } // extern "C++"
#endif #endif
...@@ -31,11 +31,11 @@ ...@@ -31,11 +31,11 @@
using std::new_handler; using std::new_handler;
using std::bad_alloc; using std::bad_alloc;
extern "C" void *malloc (size_t); extern "C" void *malloc (std::size_t);
extern new_handler __new_handler; extern new_handler __new_handler;
void * void *
operator new (size_t sz) throw (std::bad_alloc) operator new (std::size_t sz) throw (std::bad_alloc)
{ {
void *p; void *p;
......
...@@ -31,11 +31,11 @@ ...@@ -31,11 +31,11 @@
using std::new_handler; using std::new_handler;
using std::bad_alloc; using std::bad_alloc;
extern "C" void *malloc (size_t); extern "C" void *malloc (std::size_t);
extern new_handler __new_handler; extern new_handler __new_handler;
void * void *
operator new (size_t sz, const std::nothrow_t&) throw() operator new (std::size_t sz, const std::nothrow_t&) throw()
{ {
void *p; void *p;
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
#include "new" #include "new"
void * void *
operator new[] (size_t sz) throw (std::bad_alloc) operator new[] (std::size_t sz) throw (std::bad_alloc)
{ {
return ::operator new(sz); return ::operator new(sz);
} }
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
#include "new" #include "new"
void * void *
operator new[] (size_t sz, const std::nothrow_t& nothrow) throw() operator new[] (std::size_t sz, const std::nothrow_t& nothrow) throw()
{ {
return ::operator new(sz, nothrow); return ::operator new(sz, nothrow);
} }
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
#pragma implementation "typeinfo" #pragma implementation "typeinfo"
#include <stddef.h> #include <cstddef>
#include "tinfo.h" #include "tinfo.h"
#include "new" // for placement new #include "new" // for placement new
...@@ -73,7 +73,7 @@ operator== (const std::type_info& arg) const ...@@ -73,7 +73,7 @@ operator== (const std::type_info& arg) const
extern "C" void extern "C" void
__rtti_class (void *addr, const char *name, __rtti_class (void *addr, const char *name,
const __class_type_info::base_info *bl, size_t bn) const __class_type_info::base_info *bl, std::size_t bn)
{ new (addr) __class_type_info (name, bl, bn); } { new (addr) __class_type_info (name, bl, bn); }
extern "C" void extern "C" void
...@@ -274,7 +274,7 @@ do_upcast (sub_kind access_path, ...@@ -274,7 +274,7 @@ do_upcast (sub_kind access_path,
return contained_nonpublic_p (access_path); return contained_nonpublic_p (access_path);
} }
for (size_t i = n_bases; i--;) for (std::size_t i = n_bases; i--;)
{ {
upcast_result result2; upcast_result result2;
void *p = objptr; void *p = objptr;
...@@ -366,7 +366,7 @@ do_dyncast (int boff, sub_kind access_path, ...@@ -366,7 +366,7 @@ do_dyncast (int boff, sub_kind access_path,
return false; return false;
} }
bool result_ambig = false; bool result_ambig = false;
for (size_t i = n_bases; i--;) for (std::size_t i = n_bases; i--;)
{ {
dyncast_result result2; dyncast_result result2;
void *p; void *p;
...@@ -513,7 +513,7 @@ do_find_public_subobj (int boff, const type_info &subtype, void *objptr, void *s ...@@ -513,7 +513,7 @@ do_find_public_subobj (int boff, const type_info &subtype, void *objptr, void *s
if (objptr == subptr && subtype == *this) if (objptr == subptr && subtype == *this)
return contained_public; return contained_public;
for (size_t i = n_bases; i--;) for (std::size_t i = n_bases; i--;)
{ {
if (base_list[i].access != PUBLIC) if (base_list[i].access != PUBLIC)
continue; // Not public, can't be here. continue; // Not public, can't be here.
...@@ -767,7 +767,7 @@ __do_find_public_src (ptrdiff_t src2dst, ...@@ -767,7 +767,7 @@ __do_find_public_src (ptrdiff_t src2dst,
if (obj_ptr == src_ptr && *this == *src_type) if (obj_ptr == src_ptr && *this == *src_type)
return __contained_public; return __contained_public;
for (size_t i = __base_count; i--;) for (std::size_t i = __base_count; i--;)
{ {
if (!__base_info[i].__is_public_p ()) if (!__base_info[i].__is_public_p ())
continue; // Not public, can't be here. continue; // Not public, can't be here.
...@@ -894,7 +894,7 @@ __do_dyncast (ptrdiff_t src2dst, ...@@ -894,7 +894,7 @@ __do_dyncast (ptrdiff_t src2dst,
} }
bool result_ambig = false; bool result_ambig = false;
for (size_t i = __base_count; i--;) for (std::size_t i = __base_count; i--;)
{ {
__dyncast_result result2 (result.whole_details); __dyncast_result result2 (result.whole_details);
void const *base = obj_ptr; void const *base = obj_ptr;
...@@ -1089,7 +1089,7 @@ __do_upcast (const __class_type_info *dst, const void *obj_ptr, ...@@ -1089,7 +1089,7 @@ __do_upcast (const __class_type_info *dst, const void *obj_ptr,
if (src_details & __flags_unknown_mask) if (src_details & __flags_unknown_mask)
src_details = __flags; src_details = __flags;
for (size_t i = __base_count; i--;) for (std::size_t i = __base_count; i--;)
{ {
__upcast_result result2 (src_details); __upcast_result result2 (src_details);
const void *base = obj_ptr; const void *base = obj_ptr;
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
// Copyright (C) 1994, 1995, 1996, 1998, 1999, 2000 Free Software Foundation // Copyright (C) 1994, 1995, 1996, 1998, 1999, 2000 Free Software Foundation
#include "typeinfo" #include "typeinfo"
#include <cstddef>
// Class declarations shared between the typeinfo implementation files. // Class declarations shared between the typeinfo implementation files.
...@@ -200,9 +201,9 @@ struct __class_type_info : public __user_type_info { ...@@ -200,9 +201,9 @@ struct __class_type_info : public __user_type_info {
}; };
const base_info *base_list; const base_info *base_list;
size_t n_bases; std::size_t n_bases;
__class_type_info (const char *name, const base_info *bl, size_t bn) __class_type_info (const char *name, const base_info *bl, std::size_t bn)
: __user_type_info (name), base_list (bl), n_bases (bn) {} : __user_type_info (name), base_list (bl), n_bases (bn) {}
public: public:
......
...@@ -41,9 +41,9 @@ namespace __cxxabiv1 ...@@ -41,9 +41,9 @@ namespace __cxxabiv1
/* allocate and construct array */ /* allocate and construct array */
extern "C" void * extern "C" void *
__cxa_vec_new (size_t element_count, __cxa_vec_new (std::size_t element_count,
size_t element_size, std::size_t element_size,
size_t padding_size, std::size_t padding_size,
void (*constructor) (void *), void (*constructor) (void *),
void (*destructor) (void *)) void (*destructor) (void *))
{ {
...@@ -53,21 +53,21 @@ __cxa_vec_new (size_t element_count, ...@@ -53,21 +53,21 @@ __cxa_vec_new (size_t element_count,
} }
extern "C" void * extern "C" void *
__cxa_vec_new2 (size_t element_count, __cxa_vec_new2 (std::size_t element_count,
size_t element_size, std::size_t element_size,
size_t padding_size, std::size_t padding_size,
void (*constructor) (void *), void (*constructor) (void *),
void (*destructor) (void *), void (*destructor) (void *),
void *(*alloc) (size_t), void *(*alloc) (size_t),
void (*dealloc) (void *)) void (*dealloc) (void *))
{ {
size_t size = element_count * element_size + padding_size; std::size_t size = element_count * element_size + padding_size;
char *base = static_cast <char *> (alloc (size)); char *base = static_cast <char *> (alloc (size));
if (padding_size) if (padding_size)
{ {
base += padding_size; base += padding_size;
reinterpret_cast <size_t *> (base)[-1] = element_count; reinterpret_cast <std::size_t *> (base)[-1] = element_count;
} }
try try
{ {
...@@ -84,21 +84,21 @@ __cxa_vec_new2 (size_t element_count, ...@@ -84,21 +84,21 @@ __cxa_vec_new2 (size_t element_count,
} }
extern "C" void * extern "C" void *
__cxa_vec_new3 (size_t element_count, __cxa_vec_new3 (std::size_t element_count,
size_t element_size, std::size_t element_size,
size_t padding_size, std::size_t padding_size,
void (*constructor) (void *), void (*constructor) (void *),
void (*destructor) (void *), void (*destructor) (void *),
void *(*alloc) (size_t), void *(*alloc) (std::size_t),
void (*dealloc) (void *, size_t)) void (*dealloc) (void *, std::size_t))
{ {
size_t size = element_count * element_size + padding_size; std::size_t size = element_count * element_size + padding_size;
char *base = static_cast <char *> (alloc (size)); char *base = static_cast <char *> (alloc (size));
if (padding_size) if (padding_size)
{ {
base += padding_size; base += padding_size;
reinterpret_cast <size_t *> (base)[-1] = element_count; reinterpret_cast <std::size_t *> (base)[-1] = element_count;
} }
try try
{ {
...@@ -117,12 +117,12 @@ __cxa_vec_new3 (size_t element_count, ...@@ -117,12 +117,12 @@ __cxa_vec_new3 (size_t element_count,
/* construct array */ /* construct array */
extern "C" void extern "C" void
__cxa_vec_ctor (void *array_address, __cxa_vec_ctor (void *array_address,
size_t element_count, std::size_t element_count,
size_t element_size, std::size_t element_size,
void (*constructor) (void *), void (*constructor) (void *),
void (*destructor) (void *)) void (*destructor) (void *))
{ {
size_t ix = 0; std::size_t ix = 0;
char *ptr = static_cast <char *> (array_address); char *ptr = static_cast <char *> (array_address);
try try
...@@ -144,12 +144,12 @@ __cxa_vec_ctor (void *array_address, ...@@ -144,12 +144,12 @@ __cxa_vec_ctor (void *array_address,
extern "C" void extern "C" void
__cxa_vec_cctor (void *dest_array, __cxa_vec_cctor (void *dest_array,
void *src_array, void *src_array,
size_t element_count, std::size_t element_count,
size_t element_size, std::size_t element_size,
void (*constructor) (void *, void *), void (*constructor) (void *, void *),
void (*destructor) (void *)) void (*destructor) (void *))
{ {
size_t ix = 0; std::size_t ix = 0;
char *dest_ptr = static_cast <char *> (dest_array); char *dest_ptr = static_cast <char *> (dest_array);
char *src_ptr = static_cast <char *> (src_array); char *src_ptr = static_cast <char *> (src_array);
...@@ -171,14 +171,14 @@ __cxa_vec_cctor (void *dest_array, ...@@ -171,14 +171,14 @@ __cxa_vec_cctor (void *dest_array,
/* destruct array */ /* destruct array */
extern "C" void extern "C" void
__cxa_vec_dtor (void *array_address, __cxa_vec_dtor (void *array_address,
size_t element_count, std::size_t element_count,
size_t element_size, std::size_t element_size,
void (*destructor) (void *)) void (*destructor) (void *))
{ {
if (destructor) if (destructor)
{ {
char *ptr = static_cast <char *> (array_address); char *ptr = static_cast <char *> (array_address);
size_t ix = element_count; std::size_t ix = element_count;
bool unwinding = std::uncaught_exception (); bool unwinding = std::uncaught_exception ();
ptr += element_count * element_size; ptr += element_count * element_size;
...@@ -207,8 +207,8 @@ __cxa_vec_dtor (void *array_address, ...@@ -207,8 +207,8 @@ __cxa_vec_dtor (void *array_address,
/* destruct and release array */ /* destruct and release array */
extern "C" void extern "C" void
__cxa_vec_delete (void *array_address, __cxa_vec_delete (void *array_address,
size_t element_size, std::size_t element_size,
size_t padding_size, std::size_t padding_size,
void (*destructor) (void *)) void (*destructor) (void *))
{ {
__cxa_vec_delete2 (array_address, element_size, padding_size, __cxa_vec_delete2 (array_address, element_size, padding_size,
...@@ -218,8 +218,8 @@ __cxa_vec_delete (void *array_address, ...@@ -218,8 +218,8 @@ __cxa_vec_delete (void *array_address,
extern "C" void extern "C" void
__cxa_vec_delete2 (void *array_address, __cxa_vec_delete2 (void *array_address,
size_t element_size, std::size_t element_size,
size_t padding_size, std::size_t padding_size,
void (*destructor) (void *), void (*destructor) (void *),
void (*dealloc) (void *)) void (*dealloc) (void *))
{ {
...@@ -227,7 +227,7 @@ __cxa_vec_delete2 (void *array_address, ...@@ -227,7 +227,7 @@ __cxa_vec_delete2 (void *array_address,
if (padding_size) if (padding_size)
{ {
size_t element_count = reinterpret_cast <size_t *> (base)[-1]; std::size_t element_count = reinterpret_cast <std::size_t *> (base)[-1];
base -= padding_size; base -= padding_size;
try try
{ {
...@@ -246,17 +246,17 @@ __cxa_vec_delete2 (void *array_address, ...@@ -246,17 +246,17 @@ __cxa_vec_delete2 (void *array_address,
extern "C" void extern "C" void
__cxa_vec_delete3 (void *array_address, __cxa_vec_delete3 (void *array_address,
size_t element_size, std::size_t element_size,
size_t padding_size, std::size_t padding_size,
void (*destructor) (void *), void (*destructor) (void *),
void (*dealloc) (void *, size_t)) void (*dealloc) (void *, std::size_t))
{ {
char *base = static_cast <char *> (array_address); char *base = static_cast <char *> (array_address);
size_t size = 0; std::size_t size = 0;
if (padding_size) if (padding_size)
{ {
size_t element_count = reinterpret_cast <size_t *> (base)[-1]; std::size_t element_count = reinterpret_cast <std::size_t *> (base)[-1];
base -= padding_size; base -= padding_size;
size = element_count * element_size + padding_size; size = element_count * element_size + padding_size;
try try
......
...@@ -59,7 +59,9 @@ int test01(void) ...@@ -59,7 +59,9 @@ int test01(void)
VERIFY( false ); VERIFY( false );
} }
#if 0
// XXX These tests have been temporarily disabled.
//http://sources.redhat.com/ml/libstdc++/2000-10/msg00033.html
// basic_string(const char* s, size_type n, alloc) // basic_string(const char* s, size_type n, alloc)
csz01 = str01.max_size(); csz01 = str01.max_size();
// NB: As strlen(str_lit01) != csz01, this test is undefined. It // NB: As strlen(str_lit01) != csz01, this test is undefined. It
...@@ -89,7 +91,7 @@ int test01(void) ...@@ -89,7 +91,7 @@ int test01(void)
VERIFY( false ); VERIFY( false );
} }
// Build a maxsize-1 lengthed string consisting of all A's // Build a maxsize - 1 lengthed string consisting of all A's
try { try {
std::string str03(csz01 - 1, 'A'); std::string str03(csz01 - 1, 'A');
VERIFY( str03.size() == csz01 - 1 ); VERIFY( str03.size() == csz01 - 1 );
...@@ -103,7 +105,7 @@ int test01(void) ...@@ -103,7 +105,7 @@ int test01(void)
catch(...) { catch(...) {
VERIFY( false ); VERIFY( false );
} }
#endif
// basic_string(const char* s, const allocator& a = allocator()) // basic_string(const char* s, const allocator& a = allocator())
std::string str04(str_lit01); std::string str04(str_lit01);
......
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