From 1192ce7c18c80ad380ecb5aa802cc7817e494ff8 Mon Sep 17 00:00:00 2001 From: King_DuckZ Date: Sat, 14 May 2016 16:14:58 +0200 Subject: [PATCH] Warning fix on gcc --- lib/pbl/CMakeLists.txt | 4 ++-- src/machinery/tiger.c | 7 +++++++ src/main/damerau_levenshtein.c | 17 ++++++++++++----- src/main/findactions.c | 2 +- src/main/main.c | 2 +- 5 files changed, 23 insertions(+), 9 deletions(-) diff --git a/lib/pbl/CMakeLists.txt b/lib/pbl/CMakeLists.txt index 58cd345..0323ab9 100644 --- a/lib/pbl/CMakeLists.txt +++ b/lib/pbl/CMakeLists.txt @@ -1,8 +1,8 @@ cmake_minimum_required(VERSION 3.0 FATAL_ERROR) project(pbl C) -set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_RELEASE} -Wall") -set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -Wall -O3") +set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_RELEASE} -Wall -Wno-sign-compare") +set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -Wall -Wno-sign-compare -O3") option(PBL_WITH_TESTS "Enable building test programs" ON) diff --git a/src/machinery/tiger.c b/src/machinery/tiger.c index 02c0138..a42d544 100644 --- a/src/machinery/tiger.c +++ b/src/machinery/tiger.c @@ -710,8 +710,10 @@ void tiger(const char *str, t_word length, t_res res, char pad) void tiger_2_chunk(const char *str1, const char *str2, t_word length, t_res res1, t_res res2) { +#if defined(USE_BIG_ENDIAN) || defined(FORCE_ALIGNMENT) t_block tmp1; t_block tmp2; +#endif const char * end = str1 + (length&(-64)); while(str1count; } diff --git a/src/main/main.c b/src/main/main.c index deeb75e..f961f0b 100644 --- a/src/main/main.c +++ b/src/main/main.c @@ -127,7 +127,7 @@ int main (int parArgc, char* parArgv[]) { argv = malloc(sizeof(char*) * (parArgc - 1 + 1)); argv[0] = action_path; - for (z = 2; z < parArgc; ++z) { + for (z = 2; z < (size_t)parArgc; ++z) { argv[z - 1] = parArgv[z]; } argv[parArgc - 1] = NULL;