Remove build warnings with GCC 6.2 27/141527/1 accepted/tizen/4.0/unified/20170816.015423 accepted/tizen/4.0/unified/20170828.223019 accepted/tizen/unified/20170803.010335 submit/tizen/20170801.044617 submit/tizen_4.0/20170811.094300 submit/tizen_4.0/20170814.115522 submit/tizen_4.0/20170828.100009 submit/tizen_4.0_unified/20170814.115522
authorGihun Chang <gihun.chang@samsung.com>
Tue, 1 Aug 2017 02:46:09 +0000 (11:46 +0900)
committerGihun Chang <gihun.chang@samsung.com>
Tue, 1 Aug 2017 02:47:48 +0000 (11:47 +0900)
*For implicit declaration of function [-Wimplicit-function-declaration]
 . Add #include <stdio.h> prior to use of the function vsnprintf.

*For Unused bariable [-Wunused-variable]
 . Remove it. Really Unused.
 . bufSize, buf, ret

*For Ignoring return value of func() [-Wunused-result]
 . Remove the use of function by https://review.tizen.org/gerrit/#/c/124677/

Change-Id: I7e376cfc30078832141128d10b2e44cd598b9b56

src/atrace/atrace.cpp
src/trace.c

index 99176bb8dd06d591671066bfcd5dba103a535b3f..324d4daa7f5158be325c1b6860d396aede8383b0 100755 (executable)
@@ -365,12 +365,8 @@ static bool setTagsProperty(uint64_t tags)
        uint64_t *sm_for_enabled_tag = NULL;
        int fd = -1;
 
-//atrace "--init_exec" mode
+       // atrace "--init_exec" mode
        if(g_init_exec) {
-               size_t bufSize = DEF_GR_SIZE;
-               char buf[DEF_GR_SIZE];
-               int ret = 0;
-
                if(fileExists(ENABLED_TAG_FILE)) {
                        fprintf(stderr, "[Info] T-trace has been already initailized\n");
                        return false; //atrace has been already initailized.
@@ -424,7 +420,7 @@ static bool setTagsProperty(uint64_t tags)
                        }
                }
        }
-//atrace normal mode
+       // atrace normal mode
        else {
                fd = open(ENABLED_TAG_FILE, O_RDWR | O_CLOEXEC, 0666);          
                if(fd < 0){
@@ -440,7 +436,7 @@ static bool setTagsProperty(uint64_t tags)
                *sm_for_enabled_tag = tags;
        }
        // For debug
-       //fprintf(stderr, "Enabled TAGs: %u\n", (uint32_t)*sm_for_enabled_tag);
+       // fprintf(stderr, "Enabled TAGs: %u\n", (uint32_t)*sm_for_enabled_tag);
        //
        munmap(sm_for_enabled_tag, sizeof(uint64_t));
        close(fd);
@@ -542,7 +538,7 @@ static bool setUpTrace()
            excludedTags |= TTRACE_TAG_ALWAYS;
            tags &= ~excludedTags;
        }
-       printf("Tags: 0x%llx, excludedTags: 0x%llx\n", tags, excludedTags);
+       printf("Tags: 0x%lx, excludedTags: 0x%lx\n", tags, excludedTags);
     }
 
     ok &= startTrace();
@@ -818,6 +814,8 @@ int main(int argc, char **argv)
     bool traceStart = true;
     bool traceStop = true;
     bool traceDump = true;
+
+    // Global Variable Initialization
     excludedTags = 0ULL;
 
     if (argc == 2 && 0 == strcmp(argv[1], "--help")) {
index 59826ef47d143fdaaa066f9fd13fee8675145807..a4f8fcd2e44088995e43f0a18a56dceb9dbcad1d 100755 (executable)
@@ -15,6 +15,8 @@
  * limitations under the License.
  */
 
+#include <stdio.h>
+
 #include "ttrace.h"
 #include "stdarg.h"