Fix build errors for gcc 9 71/221671/2 accepted/tizen/unified/20200109.065437 submit/tizen/20200107.073356
authorSemun Lee <semun.lee@samsung.com>
Tue, 7 Jan 2020 01:44:09 +0000 (10:44 +0900)
committerSemun Lee <semun.lee@samsung.com>
Tue, 7 Jan 2020 01:52:07 +0000 (10:52 +0900)
Change-Id: I73ba8be7d8654de977ff5e85f64e6cf67b376814
Signed-off-by: Semun Lee <semun.lee@samsung.com>
CMakeLists.txt
module/src/callmgr-answer-msg.c
module/src/callmgr-audio.c
module/src/callmgr-contact.c
module/src/callmgr-cooldown.c
module/src/callmgr-sensor.c
module/src/callmgr-vr.c

index 2c489e7c57a4bd5d77782a4b214261eba888f97d..187b30a638b146803f0f343b05a813ee303e4ea5 100644 (file)
@@ -10,8 +10,7 @@ SET(INTROSPECTION "${CMAKE_SOURCE_DIR}/introspection")
 SET(CLIENTLIB "callmgr")
 SET(MODULE_RES_DIR "${PREFIX}/share/call-manager")
 
-##Address-Space Layout Randomization
-SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIE")
+SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIE -Wno-cast-function-type")
 SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pie")
 
 ADD_DEFINITIONS("-DFEATURE_DLOG_DEBUG")
index a361d3c8ecf367952589d92f53e0b0df2bcc4641..e4e4111e3332c82dafe125397bf8471ce3ccb32e 100644 (file)
@@ -16,6 +16,7 @@
  * limitations under the License.
  */
 
+#include <stdlib.h>
 #include <glib.h>
 #include <player.h>
 
index 6142ca4dd0b39d3599782250b7a973f6050ed912..ae83ce30440917777cf025df28f2f6c7659c9a80 100644 (file)
@@ -16,6 +16,7 @@
  * limitations under the License.
  */
 
+#include <stdlib.h>
 #include <sound_manager.h>
 #include <sound_manager_internal.h>
 #include <vconf.h>
index 980daba8b3517ff063921791a06e7c6ab9291b5f..a876957f66069c09aafb0cbc230ae9ad319f7800 100644 (file)
@@ -707,7 +707,7 @@ static void __callmgr_ct_add_notification(int missed_cnt)
        char current_num[83] = { 0, };
        char *str_id = NULL;
        char *disp_img_path = NULL;
-       char disp_name_str[300] = { 0, };
+       char disp_name_str[32] = { 0, };
        notification_h noti = NULL;
        notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
        app_control_h service = NULL;
@@ -948,12 +948,16 @@ static void __callmgr_ct_add_notification(int missed_cnt)
 
                                if (strstr(disp_name_str, disp_str) == NULL) {
                                        if (strlen(disp_name_str) > 0) {
-                                               char buf[32];
-                                               snprintf(buf, 32, "%s,%s", disp_name_str, disp_str);
+                                               char buf[sizeof(disp_name_str) + 1];
+                                               strncat(buf, disp_name_str, sizeof(buf) - 1);
+                                               strncat(buf, ",", sizeof(buf) - strlen(buf) - 1);
+                                               strncat(buf, disp_str, sizeof(buf) - strlen(buf) - 1);
                                                strncpy(disp_name_str, buf, 32);
+                                               disp_name_str[31] = '\0';
                                                b_is_single = false;
                                        } else {
                                                strncpy(disp_name_str, disp_str, 32);
+                                               disp_name_str[31] = '\0';
                                        }
 
                                        sec_dbg("disp_str(%s), disp_name_str(%s)", disp_str, disp_name_str);
index 42467656b4a288a56c8df262c99d43e041c68513..84e3b6b731e38c19742974d112ab69a59e744722 100644 (file)
@@ -14,6 +14,8 @@
  * limitations under the License.
  */
 
+#include <stdlib.h>
+
 #include "callmgr-cooldown.h"
 #include "callmgr-util.h"
 #include "callmgr-log.h"
index cd75914790cf50c6a3f8a878ae78ff1faed57c37..e0cdada511389dce4bb8a3718353388cbc157b77 100644 (file)
  * limitations under the License.
  */
 
-#include <vconf.h>
-#include <dbus/dbus.h>
+#include <stdlib.h>
 #include <stdint.h>
+#include <dbus/dbus.h>
+#include <vconf.h>
 #include <gesture_recognition.h>
 
 #include "callmgr-sensor.h"
index 582b339f2a2580ec407ec79d29b3f953131a2444..b9b0b3b665fd46c849dd4237c5c70b278d41eb45 100644 (file)
@@ -786,7 +786,7 @@ static int __callmgr_vr_create_filename(callmgr_vr_handle_h vr_handle)
 {
        unsigned long rec_size = 0;
        int fex_remain_size = 0;
-       char tmp_str[CM_VR_FILENAME_LEN_MAX];
+       char tmp_str[CM_VR_FILENAME_LEN_MAX * 2 + 1];
 
        dbg(">>");
 
@@ -835,7 +835,7 @@ static int __callmgr_vr_create_filename(callmgr_vr_handle_h vr_handle)
                sec_dbg("Voice Recorder File Path: [%s]", vr_handle->file_path);
                sec_dbg("Voice Recorder File Name: [%s]", vr_handle->file_name);
 
-               char dest_path[CM_VR_FILENAME_LEN_MAX] = { 0, };
+               char dest_path[CM_VR_FILENAME_LEN_MAX * 2 + 1] = { 0, };
                snprintf(dest_path, sizeof(dest_path), "%s/%s", vr_handle->file_path, vr_handle->file_name);
 
                int ret = rename(CM_VR_TEMP_FILENAME, dest_path);
@@ -858,7 +858,7 @@ static int __callmgr_vr_update_media_info(callmgr_vr_handle_h vr_handle)
        int result = -1;
        media_info_h info = NULL;
        int ret = MEDIA_CONTENT_ERROR_NONE;
-       char full_path[CM_VR_FILENAME_LEN_MAX] = { 0, };
+       char full_path[CM_VR_FILENAME_LEN_MAX * 2 + 1] = { 0, };
        snprintf(full_path, sizeof(full_path), "%s/%s", vr_handle->file_path, vr_handle->file_name);
 
        sec_dbg("full path : %s", full_path);
@@ -1079,7 +1079,7 @@ static int __callmgr_vr_update_answering_msg_media_info(callmgr_vr_handle_h vr_h
        int result = 0;
        media_info_h info = NULL;
        int ret = MEDIA_CONTENT_ERROR_NONE;
-       char full_path[CM_VR_FILENAME_LEN_MAX] = { 0, };
+       char full_path[CM_VR_FILENAME_LEN_MAX * 2 + 1] = { 0, };
        snprintf(full_path, sizeof(full_path), "%s/%s", vr_handle->file_path, vr_handle->file_name);
 
        dbg("full path : %s", full_path);