From e5a3a5b240d311cd638a0d356952d42966ba458e Mon Sep 17 00:00:00 2001 From: Gerald Pfeifer Date: Wed, 21 May 2003 00:29:54 +0200 Subject: [PATCH] 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 --- libstdc++-v3/ChangeLog | 6 ++++++ 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 + + * 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 * 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; -- 2.7.4