From acfea61fed0c9b5a0baa1f6dac3dd85e3fb28370 Mon Sep 17 00:00:00 2001 From: SeokYeon Hwang Date: Tue, 15 Jul 2014 14:55:24 +0900 Subject: [PATCH] emulator: apply strict policies on compilation warnings on Windows enable -Werror except for -Wformat, -Wformat-extra-args, -Wpointer-to-int-cast, -Wint-to-pointor-cast. Change-Id: I79a7f3a9678d3321c4989333f07f9eec4ba0522e Signed-off-by: SeokYeon Hwang --- hw/9pfs/virtio-9p-local-maru.c | 5 +++++ tizen/emulator_configure.sh | 7 +++++-- tizen/src/display/maru_sdl.c | 4 ++++ tizen/src/display/maru_sdl.h | 1 - tizen/src/skin/maruskin_operation.c | 2 +- tizen/src/util/maru_err_table.c | 2 +- tizen/src/util/sdb.c | 3 ++- 7 files changed, 18 insertions(+), 6 deletions(-) diff --git a/hw/9pfs/virtio-9p-local-maru.c b/hw/9pfs/virtio-9p-local-maru.c index a2aa07a..5ca2d15 100644 --- a/hw/9pfs/virtio-9p-local-maru.c +++ b/hw/9pfs/virtio-9p-local-maru.c @@ -334,9 +334,14 @@ update_map_file: if (credp->fc_gid != -1) { gid = credp->fc_gid; } +// FIXME +#ifndef CONFIG_WIN32 if (credp->fc_mode != -1) { mode = credp->fc_mode; } +#else + mode = credp->fc_mode; +#endif if (credp->fc_rdev != -1) { rdev = credp->fc_rdev; } diff --git a/tizen/emulator_configure.sh b/tizen/emulator_configure.sh index cebc28e..b942a1a 100755 --- a/tizen/emulator_configure.sh +++ b/tizen/emulator_configure.sh @@ -213,8 +213,11 @@ echo "" echo "##### QEMU configuring for emulator" echo "##### QEMU configure append:" $CONFIGURE_APPEND exec ./configure \ - --extra-cflags=-Werror=implicit-function-declaration \ - --extra-cflags=-Werror=implicit-int \ + --enable-werror \ + --extra-cflags=-Wno-error=format \ + --extra-cflags=-Wno-error=format-extra-args \ + --extra-cflags=-Wno-error=pointer-to-int-cast \ + --extra-cflags=-Wno-error=int-to-pointer-cast \ --extra-ldflags=-Wl,--large-address-aware \ --cc=gcc \ --disable-coroutine-pool \ diff --git a/tizen/src/display/maru_sdl.c b/tizen/src/display/maru_sdl.c index 426daa9..1c92fe7 100644 --- a/tizen/src/display/maru_sdl.c +++ b/tizen/src/display/maru_sdl.c @@ -39,6 +39,10 @@ #include "hw/pci/maru_brightness.h" #include "debug_ch.h" +#ifndef CONFIG_WIN32 +#include +#endif + MULTI_DEBUG_CHANNEL(tizen, maru_sdl); static QEMUBH *sdl_init_bh; diff --git a/tizen/src/display/maru_sdl.h b/tizen/src/display/maru_sdl.h index 342f4d2..7b30156 100644 --- a/tizen/src/display/maru_sdl.h +++ b/tizen/src/display/maru_sdl.h @@ -33,7 +33,6 @@ #define MARU_SDL_H_ #include -#include #include "ui/console.h" extern DisplayChangeListenerOps maru_dcl_ops; diff --git a/tizen/src/skin/maruskin_operation.c b/tizen/src/skin/maruskin_operation.c index 383343a..7be2597 100644 --- a/tizen/src/skin/maruskin_operation.c +++ b/tizen/src/skin/maruskin_operation.c @@ -653,7 +653,7 @@ static void send_to_emuld(const char* request_type, if(send( s, (char*)request_type, request_size, 0 ) < 0) { ERR("failed to send to emuld\n"); } - if(send( s, &buf_size, 4, 0 ) < 0) { + if(send( s, (char*)&buf_size, 4, 0 ) < 0) { ERR("failed to send to emuld\n"); } if(send( s, (char*)send_buf, buf_size, 0 ) < 0) { diff --git a/tizen/src/util/maru_err_table.c b/tizen/src/util/maru_err_table.c index b9d767f..4f34fab 100644 --- a/tizen/src/util/maru_err_table.c +++ b/tizen/src/util/maru_err_table.c @@ -262,7 +262,7 @@ void maru_dump_backtrace(void *ptr, int depth) } #ifdef CONFIG_WIN32 -static LONG maru_unhandled_exception_filter(PEXCEPTION_POINTERS pExceptionInfo){ +static WINAPI LONG maru_unhandled_exception_filter(LPEXCEPTION_POINTERS pExceptionInfo){ char module_buf[1024]; DWORD dwException = pExceptionInfo->ExceptionRecord->ExceptionCode; ERR("%d\n ", (int)dwException); diff --git a/tizen/src/util/sdb.c b/tizen/src/util/sdb.c index f2728d5..0d1c20b 100644 --- a/tizen/src/util/sdb.c +++ b/tizen/src/util/sdb.c @@ -115,7 +115,7 @@ int inet_strtoip(const char* str, uint32_t *ip) int check_port_bind_listen(uint32_t port) { struct sockaddr_in addr; - int s, opt = 1; + int s = 0; int ret = -1; socklen_t addrlen = sizeof(addr); memset(&addr, 0, addrlen); @@ -131,6 +131,7 @@ int check_port_bind_listen(uint32_t port) } #ifndef _WIN32 + int opt = 1; ret = setsockopt(s, SOL_SOCKET, SO_REUSEADDR, (char *)&opt, sizeof(int)); if (ret < 0) { -- 2.7.4