diff options
author | Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at> | 2003-05-21 00:29:54 +0200 |
---|---|---|
committer | Gerald Pfeifer <gerald@gcc.gnu.org> | 2003-05-20 22:29:54 +0000 |
commit | e5a3a5b240d311cd638a0d356952d42966ba458e (patch) | |
tree | 3d8d6a5044caa795cfe57499cfb3a2710e5e7289 | |
parent | ca5e1be83df4629faf3bccabcc8e712447ac390e (diff) | |
download | gcc-e5a3a5b240d311cd638a0d356952d42966ba458e.zip gcc-e5a3a5b240d311cd638a0d356952d42966ba458e.tar.gz gcc-e5a3a5b240d311cd638a0d356952d42966ba458e.tar.bz2 |
stl_alloc.h (__default_alloc_template::_S_chunk_alloc): Cast via void* to avoid -Wcast-align warnings.
* include/bits/stl_alloc.h (__default_alloc_template::_S_chunk_alloc):
Cast via void* to avoid -Wcast-align warnings.
(__default_alloc_template::_S_refill): Likewise.
From-SVN: r67041
-rw-r--r-- | libstdc++-v3/ChangeLog | 6 | ||||
-rw-r--r-- | libstdc++-v3/include/bits/stl_alloc.h | 10 |
2 files changed, 11 insertions, 5 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 01ddf1e..3befd71 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,9 @@ +2003-05-21 Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at> + + * include/bits/stl_alloc.h (__default_alloc_template::_S_chunk_alloc): + Cast via void* to avoid -Wcast-align warnings. + (__default_alloc_template::_S_refill): Likewise. + 2003-05-20 Benjamin Kosnik <bkoz@redhat.com> * testsuite/README: Move to... diff --git a/libstdc++-v3/include/bits/stl_alloc.h b/libstdc++-v3/include/bits/stl_alloc.h index 54ac924..4bbdd60 100644 --- a/libstdc++-v3/include/bits/stl_alloc.h +++ b/libstdc++-v3/include/bits/stl_alloc.h @@ -449,8 +449,8 @@ namespace std _Obj* volatile* __my_free_list = _S_free_list + _S_freelist_index(__bytes_left); - ((_Obj*)_S_start_free) -> _M_free_list_link = *__my_free_list; - *__my_free_list = (_Obj*)_S_start_free; + ((_Obj*)(void*)_S_start_free) -> _M_free_list_link = *__my_free_list; + *__my_free_list = (_Obj*)(void*)_S_start_free; } _S_start_free = (char*) __new_alloc::allocate(__bytes_to_get); if (_S_start_free == 0) @@ -508,12 +508,12 @@ namespace std __my_free_list = _S_free_list + _S_freelist_index(__n); // Build free list in chunk. - __result = (_Obj*)__chunk; - *__my_free_list = __next_obj = (_Obj*)(__chunk + __n); + __result = (_Obj*)(void*)__chunk; + *__my_free_list = __next_obj = (_Obj*)(void*)(__chunk + __n); for (__i = 1; ; __i++) { __current_obj = __next_obj; - __next_obj = (_Obj*)((char*)__next_obj + __n); + __next_obj = (_Obj*)(void*)((char*)__next_obj + __n); if (__nobjs - 1 == __i) { __current_obj -> _M_free_list_link = 0; |