Fix remained build errors from toolchain upgrade (gcc) 40/221940/1
authorYunjin Lee <yunjin-.lee@samsung.com>
Wed, 8 Jan 2020 09:59:07 +0000 (18:59 +0900)
committerYunjin Lee <yunjin-.lee@samsung.com>
Wed, 8 Jan 2020 09:59:07 +0000 (18:59 +0900)
- Fix errors that are remained, not checked from previous obs logs

Change-Id: I3293d0993a9c89205bfd4c5bef24c3a3d9b4c5cf
Signed-off-by: Yunjin Lee <yunjin-.lee@samsung.com>
capi/src/privilege_manager.c
test/tc-common.c
test/tc-common.h
test/tc-privilege-info.c

index c8e22c99e4c97032b009220a83537358488ff25b..eaf6646efbd09dbb7330d2aab0ec101fb17f5036 100755 (executable)
@@ -46,6 +46,7 @@
 #endif
 
 #pragma GCC diagnostic ignored "-Wstringop-truncation"
+#pragma GCC diagnostic ignored "-Wstringop-overflow"
 
 #define TryReturn(condition, expr, returnValue, ...)\
        if (!(condition)) { \
index a06d345d1da3ce463d6238a5c5dfcddbca5ed393..8fe6ec58018aed7e98acc4c8c54f3b1255474aa7 100755 (executable)
@@ -306,7 +306,6 @@ tizen_profile_t _get_tizen_profile()
        if (__builtin_expect(profile != TIZEN_PROFILE_UNKNOWN, 1))
                return profile;
 
-       char *val = NULL;
        dictionary *dic = iniparser_load(INI_PATH);
 
        if (dic == NULL) {
@@ -315,7 +314,7 @@ tizen_profile_t _get_tizen_profile()
                return profile;
        }
 
-       val = iniparser_getstring(dic, INI_KEYWORD_PROFILE, NULL);
+       const char* val = iniparser_getstring(dic, INI_KEYWORD_PROFILE, NULL);
 
        if (val != NULL) {
                switch (*val) {
index cb1b5bcecc3db633874c001a3096f2197e8253c3..53f7fb440e757b4d7d0ece150015c903b361438b 100755 (executable)
                error_message = NULL; \
        }
 #define gfree(list) \
-       g_list_free(list); \
-       list = NULL;
+       if (list) { \
+               g_list_free(list); \
+               list = NULL; \
+       }
 
 int success_cnt;
 int fail_cnt;
index 5edef2e31eaf6ddcede233d92e869f97cb8216b3..5e0a27723eb4df9f064f413db763ec2fa73e793b 100755 (executable)
@@ -298,8 +298,7 @@ static void __test_privilege_info_get_privilege_list_by_privacy()
                printf_red("Test FAILED\n");
        }
 
-       if (privilege_list != NULL)
-               gfree(privilege_list);
+       gfree(privilege_list);
 
        __print_line();
 
@@ -317,8 +316,7 @@ static void __test_privilege_info_get_privilege_list_by_privacy()
                printf_red("Test FAILED\n");
        }
 
-       if (privilege_list != NULL)
-               gfree(privilege_list);
+       gfree(privilege_list);
 
        __print_line();