Skip to content

Commit 37f0d65

Browse files
committed
Minor changes to fix compilation errors when compiled w/ g++ 7.3 (Ubuntu 18.04)
This is part of my effort to port RAMCloud to run on CloudLab r320 machines, which have Infiniband 56Gbps HCA's.
1 parent 8dd7cef commit 37f0d65

File tree

6 files changed

+16
-2
lines changed

6 files changed

+16
-2
lines changed

apps/ClusterPerf.cc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,10 @@ namespace po = boost::program_options;
5656
#include "Transaction.h"
5757
#include "Util.h"
5858

59+
#if __GNUC__ && (__GNUC__ >= 7)
60+
#pragma GCC diagnostic ignored "-Wformat-truncation"
61+
#endif
62+
5963
using namespace RAMCloud;
6064

6165
// Shared state for client library.
@@ -7540,3 +7544,7 @@ catch (std::exception& e) {
75407544
Logger::get().sync();
75417545
exit(1);
75427546
}
7547+
7548+
#if __GNUC__ && (__GNUC__ >= 7)
7549+
#pragma GCC diagnostic warning "-Wformat-truncation"
7550+
#endif

src/HashTableTest.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,9 @@ class HashTableTest : public ::testing::Test {
323323
// fill in the "log" entries
324324
for (uint64_t i = 0; i < numEnt; i++) {
325325
string stringKey = format("%lu", i);
326+
#pragma GCC diagnostic ignored "-Waligned-new=all"
326327
values.push_back(new TestObject(tableId, stringKey));
328+
#pragma GCC diagnostic warning "-Waligned-new=all"
327329
Key key(values[i]->tableId,
328330
values[i]->stringKeyPtr,
329331
values[i]->stringKeyLength);

src/MockTransport.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,9 @@
1313
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
1414
*/
1515

16+
#pragma GCC diagnostic ignored "-Wconversion"
1617
#include <gtest/gtest.h>
17-
18+
#pragma GCC diagnostic warning "-Wconversion"
1819
#include <queue>
1920

2021
#include "ServiceLocator.h"

src/TestRunner.cc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
1414
*/
1515

16-
#include <gtest/gtest.h>
1716
#include <boost/program_options.hpp>
1817

1918
#include "TestUtil.h"

src/TestUtil.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@
2121
#ifndef RAMCLOUD_TESTUTIL_H
2222
#define RAMCLOUD_TESTUTIL_H
2323

24+
#pragma GCC diagnostic ignored "-Wconversion"
2425
#include <gtest/gtest.h>
26+
#pragma GCC diagnostic warning "-Wconversion"
2527
#include <regex.h>
2628
#include <sstream>
2729

src/TimeTrace.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,9 @@ class TimeTrace {
200200
template<typename... Args>
201201
inline void record(uint64_t timestamp, const char* format, Args... args)
202202
{
203+
#pragma GCC diagnostic ignored "-Wnarrowing"
203204
uint32_t eventArgs[] = {args...};
205+
#pragma GCC diagnostic warning "-Wnarrowing"
204206
if (expect_true(TimeTrace::activeReaders == 0)) {
205207
Event* event = &events[nextIndex];
206208
nextIndex = (nextIndex + 1) & BUFFER_MASK;

0 commit comments

Comments
 (0)