From eea13e4d72af4fb83a3d6c4671ae29d1c4305c49 Mon Sep 17 00:00:00 2001 From: "arseny.kapoulkine@gmail.com" Date: Tue, 6 Mar 2012 07:02:40 +0000 Subject: Fix 'cast increases required alignment of target type' warning for BlackBerry NDK in PUGIXML_WCHAR_MODE (wchar_t is 4 bytes) git-svn-id: http://pugixml.googlecode.com/svn/trunk@842 99668b35-9821-0410-8761-19e4c4f06640 --- src/pugixml.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/pugixml.cpp') diff --git a/src/pugixml.cpp b/src/pugixml.cpp index ab18c74..bc76b0b 100644 --- a/src/pugixml.cpp +++ b/src/pugixml.cpp @@ -348,7 +348,9 @@ namespace assert(full_size < (1 << 16) || (page->busy_size == full_size && page_offset == 0)); header->full_size = static_cast(full_size < (1 << 16) ? full_size : 0); - return reinterpret_cast(header + 1); + // round-trip through void* to avoid 'cast increases required alignment of target type' warning + // header is guaranteed a pointer-sized alignment, which should be enough for char_t + return static_cast(static_cast(header + 1)); } void deallocate_string(char_t* string) -- cgit v1.2.3