pool allocator changes and delete[] void*
Gabriel Dos Reis
gdr@integrable-solutions.net
Fri Dec 26 15:55:00 GMT 2003
Paolo Carlini <pcarlini@suse.de> writes:
| Gerald Pfeifer wrote:
|
| >I'm afraid the recent pool allocator changes are causing troubles (or
| >at least tons of warnings):
| >
| > /gcc-current/bin/../lib/gcc/$platform/3.4.0/../../../../
| > include/c++/3.4.0/ext/pool_allocator.h:320:
| > warning: deleting `void*' is undefined
| >
| Right Gerald. Please consider that this is work in progress: at least the
| signature of __pool_alloc::deallocate should be changed, consistently with
| that prescribed for class allocator by the Standard (20.4.1).
|
| For now, I think you can safely suppress annoying warnings with
| the attached.
|
| Paolo.
|
| //////////
|
| --- pool_allocator.h.orig 2003-12-26 15:05:17.000000000 +0100
| +++ pool_allocator.h 2003-12-26 15:22:51.000000000 +0100
| @@ -317,7 +317,7 @@
| __pool_alloc<__threads, __inst>::deallocate(void* __p, size_t __n)
| {
| if ((__n > (size_t) _S_max_bytes) || (_S_force_new > 0))
| - delete [] __p;
| + delete [] static_cast<char*>(__p);
Please don't write that. Say what you mean: Call the deallocation *function*
operator delete[] (p);
-- Gaby
More information about the Libstdc++
mailing list