Fix build warning and Modify Makefile to make warning error 57/227457/6 submit/tizen/20200313.001656
authorhj kim <backto.kim@samsung.com>
Thu, 12 Mar 2020 05:34:46 +0000 (14:34 +0900)
committerhj kim <backto.kim@samsung.com>
Fri, 13 Mar 2020 00:49:51 +0000 (09:49 +0900)
Change-Id: I47089d3e772155ed3cde0a9871635424ed9d6de1

Makefile.am
packaging/media-server.spec
src/mediadb-update.c

index 24fc646..1369587 100755 (executable)
@@ -29,7 +29,8 @@ COMMON_CFLAGS = -I${srcdir}/lib/include \
                $(SMACK_CFLAGS) \
                $(USB_DEVICE_CFLAGS) \
                $(PHONESTATUS_CFLAGS) \
-               $(SYSTEM_DEVICE_CFLAGS)
+               $(SYSTEM_DEVICE_CFLAGS) \
+               -Wall -Werror -Wno-deprecated -Wno-deprecated-declarations -Wno-cpp
 
 COMMON_LDADD = libmedia-utils.la \
                $(GLIB_LIBS) \
@@ -77,7 +78,8 @@ libmedia_utils_la_CFLAGS = -I${srcdir}/lib/include \
                              $(CYNARA_CLIENT_CFLAGS) \
                              $(CYNARA_SESSION_CFLAGS) \
                              $(CYNARA_CREDS_SOCKET_CFLAGS) \
-                             $(SYSTEM_INFO_CFLAGS)
+                             $(SYSTEM_INFO_CFLAGS) \
+                             -Wall -Werror -Wno-deprecated -Wno-deprecated-declarations -Wno-cpp
 
 libmedia_utils_la_LIBADD  =   $(GLIB_LIBS) \
                               $(DLOG_LIBS) \
@@ -199,7 +201,8 @@ mediadb_update_CFLAGS = -I${srcdir}/lib/include \
                        $(GTHREAD_CFLAGS) \
                        $(SQLITE3_CFLAGS) \
                        $(GLIB_CFLAGS) \
-                       $(GIO_CFLAGS)
+                       $(GIO_CFLAGS) \
+                       -Wall -Werror -Wno-deprecated -Wno-deprecated-declarations -Wno-cpp
 
 mediadb_update_CFLAGS += -fPIE
 
index 3ee4fb7..fd0033e 100755 (executable)
@@ -1,6 +1,6 @@
 Name:       media-server
 Summary:    A server for media content management
-Version:    0.4.5
+Version:    0.4.6
 Release:    0
 Group:      Multimedia/Service
 License:    Apache-2.0
index 87519a1..0d99d1b 100755 (executable)
@@ -187,9 +187,9 @@ int main(int argc, char **argv)
                        len = strlen(argv1);
                        if (len < sizeof(req_path)) {
                                if (argv1[len - 1] == '/')
-                                       strncpy(req_path, argv1, len - 1);
+                                       g_strlcpy(req_path, argv1, len - 1);
                                else
-                                       strncpy(req_path, argv1, len);
+                                       g_strlcpy(req_path, argv1, len);
                        }
                        ret = dir_scan(req_path, false);
                        if (ret != 0) {
@@ -208,9 +208,9 @@ int main(int argc, char **argv)
                                len = strlen(argv2);
                                if (len < sizeof(req_path)) {
                                        if (argv2[len - 1] == '/')
-                                               strncpy(req_path, argv2, len - 1);
+                                               g_strlcpy(req_path, argv2, len - 1);
                                        else
-                                               strncpy(req_path, argv2, len);
+                                               g_strlcpy(req_path, argv2, len);
                                }
 
                                ret = dir_scan(req_path, true);