diff --git a/android-config b/android-config index c31ae1aa..21d269d8 100755 --- a/android-config +++ b/android-config @@ -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" \ diff --git a/configure.ac b/configure.ac index b77f8d90..758e4b71 100644 --- a/configure.ac +++ b/configure.ac @@ -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 diff --git a/lib/nghttp2_map.h b/lib/nghttp2_map.h index 87744272..83f425d9 100644 --- a/lib/nghttp2_map.h +++ b/lib/nghttp2_map.h @@ -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 { diff --git a/lib/nghttp2_stream.c b/lib/nghttp2_stream.c index cdb67f2f..e94613a3 100644 --- a/lib/nghttp2_stream.c +++ b/lib/nghttp2_stream.c @@ -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); }