# HG changeset patch # User Yasumasa Suenaga # Date 1509434508 -32400 # Node ID 1885f234b75b54618b3415484a5430837d229101 # Parent 6fd99b983c37e09264291467d82c9fb50e27cc1b Bug 3456: Build warnings w/ GCC 7.2.1 Reviewed-by: ykubota https://github.com/HeapStats/heapstats/pull/121 diff -r 6fd99b983c37 -r 1885f234b75b ChangeLog --- a/ChangeLog Tue Oct 10 23:39:34 2017 +0900 +++ b/ChangeLog Tue Oct 31 16:21:48 2017 +0900 @@ -1,3 +1,7 @@ +2017-10-31 Yasumasa Suenaga + + * Bug 3456: Build warnings w/ GCC 7.2.1 + 2017-10-10 KUBOTA Yuji * Bug 3464: Fix launcher and attacher to use on Ubuntu diff -r 6fd99b983c37 -r 1885f234b75b agent/src/heapstats-engines/gcWatcher.cpp --- a/agent/src/heapstats-engines/gcWatcher.cpp Tue Oct 10 23:39:34 2017 +0900 +++ b/agent/src/heapstats-engines/gcWatcher.cpp Tue Oct 31 16:21:48 2017 +0900 @@ -1,7 +1,7 @@ /*! * \file gcWatcher.cpp * \brief This file is used to take snapshot when finish garbage collection. - * Copyright (C) 2011-2015 Nippon Telegraph and Telephone Corporation + * Copyright (C) 2011-2017 Nippon Telegraph and Telephone Corporation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -55,6 +55,8 @@ * \param jni [in] JNI environment object. * \param data [in] Pointer of user data. */ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-label" void JNICALL TGCWatcher::entryPoint(jvmtiEnv *jvmti, JNIEnv *jni, void *data) { /* Get self. */ TGCWatcher *controller = (TGCWatcher *)data; @@ -92,6 +94,7 @@ /* Change running state. */ controller->_isRunning = false; } +#pragma GCC diagnostic pop /*! * \brief Make and begin Jthread. diff -r 6fd99b983c37 -r 1885f234b75b agent/src/heapstats-engines/jvmSockCmd.cpp --- a/agent/src/heapstats-engines/jvmSockCmd.cpp Tue Oct 10 23:39:34 2017 +0900 +++ b/agent/src/heapstats-engines/jvmSockCmd.cpp Tue Oct 31 16:21:48 2017 +0900 @@ -1,7 +1,7 @@ /*! * \file jvmSockCmd.cpp * \brief This file is used by thread dump. - * Copyright (C) 2011-2015 Nippon Telegraph and Telephone Corporation + * Copyright (C) 2011-2017 Nippon Telegraph and Telephone Corporation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -305,6 +305,8 @@ * \param pathLen [in] Max length of param "path". * \return Search result. */ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wformat-truncation" bool TJVMSockCmd::findJvmSock(char* path, int pathLen) { /* Sanity check. */ if (unlikely(path == NULL || pathLen <= 0)) { @@ -357,6 +359,7 @@ return true; } +#pragma GCC diagnostic pop /*! * \brief Create attach file. @@ -364,6 +367,8 @@ * \param pathLen [in] Max length of param "path". * \return Process result. */ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wformat-truncation" bool TJVMSockCmd::createAttachFile(char* path, int pathLen) { /* Sanity check. */ if (unlikely(path == NULL || pathLen <= 0)) { @@ -425,3 +430,5 @@ return true; } +#pragma GCC diagnostic pop + diff -r 6fd99b983c37 -r 1885f234b75b agent/src/heapstats-engines/snapShotProcessor.cpp --- a/agent/src/heapstats-engines/snapShotProcessor.cpp Tue Oct 10 23:39:34 2017 +0900 +++ b/agent/src/heapstats-engines/snapShotProcessor.cpp Tue Oct 31 16:21:48 2017 +0900 @@ -57,6 +57,8 @@ * \param jni [in] JNI environment information. * \param data [in] Monitor-object for class-container. */ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-label" void JNICALL TSnapShotProcessor::entryPoint(jvmtiEnv *jvmti, JNIEnv *jni, void *data) { /* Ranking pointer. */ @@ -137,6 +139,7 @@ /* Change running state. */ controller->_isRunning = false; } +#pragma GCC diagnostic pop /*! * \brief Start parallel work by JThread.