Fix -Werror=cast-align error on 32 bit platform

Fixes GH-172
This commit is contained in:
Tatsuhiro Tsujikawa 2015-03-03 22:36:24 +09:00
parent 4de8db523f
commit dbd0f032ce
4 changed files with 10 additions and 0 deletions

View File

@ -39,6 +39,7 @@ PATH=$TOOLCHAIN/bin:$PATH
--without-libxml2 \
--disable-python-bindings \
--disable-examples \
--enable-werror \
CC=clang \
CXX=clang++ \
CPPFLAGS="-I$PREFIX/include" \

View File

@ -549,6 +549,10 @@ if test "x$have_struct_tm_tm_gmtoff" = "xyes"; then
[Define to 1 if you have `struct tm.tm_gmtoff` member.])
fi
# Check size of pointer to decide we need 8 bytes alignment
# adjustment.
AC_CHECK_SIZEOF([int *])
# Checks for library functions.
if test "x$cross_compiling" != "xyes"; then
AC_FUNC_MALLOC

View File

@ -40,6 +40,10 @@ typedef uint32_t key_type;
typedef struct nghttp2_map_entry {
struct nghttp2_map_entry *next;
key_type key;
#if SIZEOF_INT_P == 4
/* we requires 8 bytes aligment */
int64_t pad;
#endif
} nghttp2_map_entry;
typedef struct {

View File

@ -119,6 +119,7 @@ static int stream_push_item(nghttp2_stream *stream, nghttp2_session *session) {
}
break;
default:
rv = 0;
/* should not reach here */
assert(0);
}