From a8c65529b7786a287e5fe6ab84e6d62989da2288 Mon Sep 17 00:00:00 2001 From: Richard Chapman Date: Wed, 14 Aug 2024 16:37:25 +0100 Subject: [PATCH] HPCC-32439 Make all warnings into errors in Roxie subdirectory Signed-off-by: Richard Chapman --- roxie/ccd/CMakeLists.txt | 1 + roxie/ccdcache/CMakeLists.txt | 1 + roxie/roxie/CMakeLists.txt | 1 + roxie/roxiemem/CMakeLists.txt | 1 + roxie/roxiepipe/CMakeLists.txt | 1 + roxie/topo/CMakeLists.txt | 1 + roxie/udplib/CMakeLists.txt | 1 + roxie/udplib/udpmsgpk.cpp | 4 +++- roxie/udplib/udpsim.cpp | 6 +++--- roxie/udplib/udptrr.cpp | 4 +--- roxie/udplib/udptrs.cpp | 2 +- roxie/udplib/uttest.cpp | 6 +++--- 12 files changed, 18 insertions(+), 11 deletions(-) diff --git a/roxie/ccd/CMakeLists.txt b/roxie/ccd/CMakeLists.txt index b4071531955..e71d92b272f 100644 --- a/roxie/ccd/CMakeLists.txt +++ b/roxie/ccd/CMakeLists.txt @@ -25,6 +25,7 @@ project( ccd ) +SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${STRICT_CXX_FLAGS}") IF (USE_TBBMALLOC AND USE_TBBMALLOC_ROXIE) find_package(TBB CONFIG REQUIRED) diff --git a/roxie/ccdcache/CMakeLists.txt b/roxie/ccdcache/CMakeLists.txt index c7557f5fea6..05d6c9eba00 100644 --- a/roxie/ccdcache/CMakeLists.txt +++ b/roxie/ccdcache/CMakeLists.txt @@ -16,6 +16,7 @@ project( ccdcache ) +SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${STRICT_CXX_FLAGS}") set ( SRCS ccdcache.cpp diff --git a/roxie/roxie/CMakeLists.txt b/roxie/roxie/CMakeLists.txt index 20af377415c..313b53f3875 100644 --- a/roxie/roxie/CMakeLists.txt +++ b/roxie/roxie/CMakeLists.txt @@ -25,6 +25,7 @@ project( roxie ) +SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${STRICT_CXX_FLAGS}") set ( SRCS roxie.cpp diff --git a/roxie/roxiemem/CMakeLists.txt b/roxie/roxiemem/CMakeLists.txt index c0e020a43e2..9c60c6f38e3 100644 --- a/roxie/roxiemem/CMakeLists.txt +++ b/roxie/roxiemem/CMakeLists.txt @@ -22,6 +22,7 @@ ##################################################### project( roxiemem ) +SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${STRICT_CXX_FLAGS}") if(USE_TBB) find_package(TBB CONFIG REQUIRED) diff --git a/roxie/roxiepipe/CMakeLists.txt b/roxie/roxiepipe/CMakeLists.txt index 3b3d8023f6e..273efe26e1d 100644 --- a/roxie/roxiepipe/CMakeLists.txt +++ b/roxie/roxiepipe/CMakeLists.txt @@ -24,6 +24,7 @@ project( roxiepipe ) +SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${STRICT_CXX_FLAGS}") set ( SRCS roxiepipe.cpp diff --git a/roxie/topo/CMakeLists.txt b/roxie/topo/CMakeLists.txt index a5339d81aca..01fdfb46832 100644 --- a/roxie/topo/CMakeLists.txt +++ b/roxie/topo/CMakeLists.txt @@ -25,6 +25,7 @@ project( toposerver ) +SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${STRICT_CXX_FLAGS}") set ( SRCS toposerver.cpp diff --git a/roxie/udplib/CMakeLists.txt b/roxie/udplib/CMakeLists.txt index 500b412bd0c..cb74155586c 100644 --- a/roxie/udplib/CMakeLists.txt +++ b/roxie/udplib/CMakeLists.txt @@ -25,6 +25,7 @@ project (AllProjects) +SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${STRICT_CXX_FLAGS}") include ( udplib.cmake) include ( udptransport.cmake) diff --git a/roxie/udplib/udpmsgpk.cpp b/roxie/udplib/udpmsgpk.cpp index 06d8a694973..50de82e2f9b 100644 --- a/roxie/udplib/udpmsgpk.cpp +++ b/roxie/udplib/udpmsgpk.cpp @@ -68,7 +68,9 @@ class PackageSequencer : public CInterface, implements IInterface unsigned headerSize; const RoxiePacketHeader *header; unsigned maxSeqSeen = 0; +#ifdef _DEBUG unsigned numPackets = 0; +#endif bool outOfBand = false; MemoryBuffer metadata; @@ -219,7 +221,7 @@ class PackageSequencer : public CInterface, implements IInterface unsigned pktseq = fingerHdr->pktSeq & UDP_PACKET_SEQUENCE_MASK; if (pktseq == prevseq+1) { - unsigned packetDataSize = fingerHdr->length - fingerHdr->metalength - sizeof(UdpPacketHeader); + [[maybe_unused]] unsigned packetDataSize = fingerHdr->length - fingerHdr->metalength - sizeof(UdpPacketHeader); assert(packetDataSize < roxiemem::DATA_ALIGNMENT_SIZE); if (pktseq == 0) { diff --git a/roxie/udplib/udpsim.cpp b/roxie/udplib/udpsim.cpp index 4f9322f6f32..19f67a7d919 100644 --- a/roxie/udplib/udpsim.cpp +++ b/roxie/udplib/udpsim.cpp @@ -129,7 +129,7 @@ void initOptions(int argc, const char **argv) { Owned defaults = createPTreeFromYAMLString(defaultYaml); IPropertyTree * allowed = defaults->queryPropTree("udpsim"); - for (unsigned argNo = 1; argNo < argc; argNo++) + for (int argNo = 1; argNo < argc; argNo++) { const char *arg = argv[argNo]; if (arg[0]=='-' && arg[1]=='-') @@ -248,7 +248,7 @@ static unsigned completedThreads = 0; void simulateTraffic() { - const unsigned maxSendQueueSize = 100; + unsigned maxSendQueueSize = 100; try { myNode.setIp(IpAddress("1.2.3.4")); @@ -258,7 +258,7 @@ void simulateTraffic() unsigned begin = msTick(); std::atomic workValue{0}; - asyncFor(numThreads+1, numThreads+1, [&workValue, maxSendQueueSize, &rm, &mc, &rowManager](unsigned i) + asyncFor(numThreads+1, numThreads+1, [&workValue, &rm, &mc, &rowManager, maxSendQueueSize](unsigned i) { if (!i) { diff --git a/roxie/udplib/udptrr.cpp b/roxie/udplib/udptrr.cpp index 1f3c1bc3164..940ca28a9fc 100644 --- a/roxie/udplib/udptrr.cpp +++ b/roxie/udplib/udptrr.cpp @@ -953,8 +953,6 @@ class CReceiveManager : implements IReceiveManager, public CInterface void noteDone(UdpSenderEntry *requester, const UdpRequestToSendMsg &msg) { const unsigned flowSeq = msg.flowSeq; - SendPermit * permit = requester->queryPermit(flowSeq); - //A completed message, on the data flow, may often be received after the next request to send. //If so it should not update the state, but it should clear all grants with a flowid <= the new flowid //since all the data will have been sent. (If it has not been received it is either lost or OOO (unlikely).) @@ -1538,7 +1536,7 @@ class CReceiveManager : implements IReceiveManager, public CInterface //any other sender for the udpPermitTimeout period unsigned maxSlotsPerClient = (udpMaxPendingPermits == 1) ? queue_size : (udpMaxClientPercent * queue_size) / (udpMaxPendingPermits * 100); assertex(maxSlotsPerClient != 0); - if (maxSlotsPerClient > queue_size) + if ((int) maxSlotsPerClient > queue_size) maxSlotsPerClient = queue_size; if (udpResendLostPackets && maxSlotsPerClient > TRACKER_BITS) maxSlotsPerClient = TRACKER_BITS; diff --git a/roxie/udplib/udptrs.cpp b/roxie/udplib/udptrs.cpp index 96ad0829a87..7becc7a2af5 100644 --- a/roxie/udplib/udptrs.cpp +++ b/roxie/udplib/udptrs.cpp @@ -989,7 +989,7 @@ class CSendManager : implements ISendManager, public CInterface #endif while(running) { - UdpPermitToSendMsg f = { flowType::ok_to_send, 0, { } }; + UdpPermitToSendMsg f = { flowType::ok_to_send, 0, 0, { }, { } }; unsigned readsize = udpResendLostPackets ? sizeof(UdpPermitToSendMsg) : offsetof(UdpPermitToSendMsg, seen); while (running) { diff --git a/roxie/udplib/uttest.cpp b/roxie/udplib/uttest.cpp index de3f2472c0a..497cda66e9c 100644 --- a/roxie/udplib/uttest.cpp +++ b/roxie/udplib/uttest.cpp @@ -156,7 +156,7 @@ class Receiver : public Thread allReceived = 0; } - virtual void start() + void startReceiver() { Thread::start(false); started.wait(); @@ -297,7 +297,7 @@ void testNxN() DBGLOG("Ready to start"); if (receiving) { - receiver.start(); + receiver.startReceiver(); if (numNodes > 1) Sleep(5000); } @@ -563,7 +563,7 @@ class SortSlave : public Thread } void sendTo(unsigned datasize, unsigned slaveIdx) { - assert(slaveIdx != myIdx); + assert(slaveIdx != (unsigned) myIdx); DBGLOG("Node %d sending %d bytes to node %d", myIdx, datasize, slaveIdx); master->noteTransferStart(myIdx, slaveIdx); Sleep(datasize);