From f59d808b0c4d8897be12542ec152deb12a272961 Mon Sep 17 00:00:00 2001 From: Yunjin Lee Date: Tue, 19 Apr 2016 09:08:24 +0900 Subject: Revise compiler and linker options Change-Id: Ia6b6fd54cca3a8cad92df5812edd486f518f44a2 Signed-off-by: Yunjin Lee --- CMakeLists.txt | 10 +++++++++- ug/src/privacy_list_view.c | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 92b3245..134739c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,11 +5,19 @@ INCLUDE(FindPkgConfig) STRING(REGEX MATCH "([^.]*)" SO_VERSION "${VERSION}") +# Set compiler flags SET(CMAKE_C_FLAGS_RELEASE "-O2 -Wall") SET(CMAKE_C_FLAGS_DEBUG "-O0 -Wall -g -ggdb") SET(CMAKE_C_FLAGS_CCOV "-O2 -Wall --coverage") -ADD_DEFINITIONS("-Werror") +ADD_DEFINITIONS("-Werror") # Make all warnings into errors. +ADD_DEFINITIONS("-Wall") # Generate all warnings +ADD_DEFINITIONS("-Wextra") # Generate even more extra warnings +ADD_DEFINITIONS("-Wno-unused-parameter") # Ignore unused parameter + +# Set linker flags +SET(CMAKE_SHARED_LINKER_FLAGS "-Wl,--as-needed") +SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed") SET(PREFIX ${CMAKE_INSTALL_PREFIX}) diff --git a/ug/src/privacy_list_view.c b/ug/src/privacy_list_view.c index 14efde5..bf637c2 100644 --- a/ug/src/privacy_list_view.c +++ b/ug/src/privacy_list_view.c @@ -80,7 +80,7 @@ void create_privacy_list_view(struct ug_data_s *ugd) itc->func.del = gl_del_cb; Elm_Object_Item *it = NULL; int i = 0; - for (i = 0; i < g_list_length(ugd->privacy_list); ++i) { + for (i = 0; i < (int)g_list_length(ugd->privacy_list); ++i) { item_data_s *id = calloc(sizeof(item_data_s), 1); id->index = i; id->title = (char*)g_list_nth_data(ugd->privacy_list, i); -- cgit v1.2.3