From: Semun Lee Date: Thu, 26 Dec 2019 06:49:40 +0000 (+0900) Subject: Fix build warnings for gcc9 X-Git-Tag: accepted/tizen/6.0/unified/20201030.113920^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fheads%2Faccepted%2Ftizen_8.0_unified;p=platform%2Fcore%2Ftelephony%2Ftel-plugin-vmodem.git Fix build warnings for gcc9 - Ignore implicit-fallthrough warning for intended code - Fix buffer size for strncat Change-Id: I004639407efa462291e20357bd47fb221ced3ae0 Signed-off-by: Semun Lee --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 154792c..962a3bd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -19,7 +19,7 @@ ENDFOREACH(flag) INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include/) -SET(ADDITIONAL_CFLAGS "-Wall -Wno-array-bounds -Wno-empty-body -Wno-ignored-qualifiers -Wshadow -Wwrite-strings -Wswitch-default -Wno-unused-but-set-parameter -Wno-unused-but-set-variable -Wcast-qual") +SET(ADDITIONAL_CFLAGS "-Wall -Wno-array-bounds -Wno-empty-body -Wno-ignored-qualifiers -Wshadow -Wwrite-strings -Wswitch-default -Wno-unused-but-set-parameter -Wno-unused-but-set-variable -Wcast-qual -Wno-implicit-fallthrough") SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}") SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror -Wextra -fvisibility=hidden -fPIC") SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-unused-parameter -Wno-missing-field-initializers -Wdeclaration-after-statement -Wmissing-declarations -Wredundant-decls -Wcast-align") diff --git a/src/vdpram_dump.c b/src/vdpram_dump.c index 09c0e1a..8e0fd11 100644 --- a/src/vdpram_dump.c +++ b/src/vdpram_dump.c @@ -41,10 +41,10 @@ static void hex_dump(const char *pad, int size, const void *data) p = (unsigned const char *)data; - snprintf(buf, 255, "%s%04X: ", pad, 0); + snprintf(buf, sizeof(buf), "%s%04X: ", pad, 0); for (i = 0; i < size; i++) { snprintf(hex, 4, "%02X ", p[i]); - strncat(buf, hex, strlen(hex)); + strncat(buf, hex, sizeof(buf) - strlen(buf) - 1); if ((i + 1) % 8 == 0) { if ((i + 1) % 16 == 0) {