[mingw-qpid-cpp: 17/28] Added patches for gcc4.6
Kalev Lember
kalev at fedoraproject.org
Wed Mar 7 17:18:14 UTC 2012
commit 039a196c2f18f6cbd1128990619f7e3add98e3b8
Author: Ted Ross <ross at localhost.localdomain>
Date: Fri Jul 8 11:15:53 2011 -0400
Added patches for gcc4.6
mingw32-qpid-cpp.spec | 2 +
qpid-gcc46.patch | 188 +++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 190 insertions(+), 0 deletions(-)
---
diff --git a/mingw32-qpid-cpp.spec b/mingw32-qpid-cpp.spec
index 99270ac..66718d6 100644
--- a/mingw32-qpid-cpp.spec
+++ b/mingw32-qpid-cpp.spec
@@ -19,6 +19,7 @@ Source0: http://www.apache.org/dist/qpid/0.10/qpid-0.10.tar.gz
Patch0: QPID-3159.patch
Patch1: qpid-mingw32.patch
Patch2: qpid-mutable.patch
+Patch3: qpid-gcc46.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
@@ -41,6 +42,7 @@ an AMQP message broker using the AMQP protocol.
%patch0 -p2
%patch1 -p2
%patch2 -p1
+%patch3 -p2
%build
%{__mkdir_p} build
diff --git a/qpid-gcc46.patch b/qpid-gcc46.patch
new file mode 100644
index 0000000..8aa5a66
--- /dev/null
+++ b/qpid-gcc46.patch
@@ -0,0 +1,188 @@
+commit 22569544f37d5910f998e1e67a199f779b3056a2
+Author: Andrew Stitcher <astitcher at apache.org>
+Date: Tue Jun 7 21:33:46 2011 +0000
+
+ QPID-3284: Eliminated warnings from gcc 4.6 compiler
+ - Removed a bunch of variables set but not further used.
+ - Rejigged some asserts which would now have unused vars
+ if compiler -DNDEBUG
+
+ git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1133166 13f79535-47bb-0310-9956-ffa450edef68
+
+ Conflicts:
+
+ qpid/cpp/src/qpid/broker/QueueFlowLimit.cpp
+
+diff --git a/qpid/cpp/src/qmf/engine/ResilientConnection.cpp b/qpid/cpp/src/qmf/engine/ResilientConnection.cpp
+index ab65b8d..41dd9ff 100644
+--- a/qpid/cpp/src/qmf/engine/ResilientConnection.cpp
++++ b/qpid/cpp/src/qmf/engine/ResilientConnection.cpp
+@@ -334,8 +334,7 @@ void ResilientConnectionImpl::notify()
+ {
+ if (notifyFd != -1)
+ {
+- int unused_ret; //Suppress warnings about ignoring return value.
+- unused_ret = ::write(notifyFd, ".", 1);
++ (void) ::write(notifyFd, ".", 1);
+ }
+ }
+
+@@ -432,8 +431,7 @@ void ResilientConnectionImpl::EnqueueEvent(ResilientConnectionEvent::EventKind k
+
+ if (notifyFd != -1)
+ {
+- int unused_ret; //Suppress warnings about ignoring return value.
+- unused_ret = ::write(notifyFd, ".", 1);
++ (void) ::write(notifyFd, ".", 1);
+ }
+ }
+
+diff --git a/qpid/cpp/src/qpid/broker/ConnectionHandler.cpp b/qpid/cpp/src/qpid/broker/ConnectionHandler.cpp
+index 3f97e5b..84120ab 100644
+--- a/qpid/cpp/src/qpid/broker/ConnectionHandler.cpp
++++ b/qpid/cpp/src/qpid/broker/ConnectionHandler.cpp
+@@ -256,7 +256,6 @@ void ConnectionHandler::Handler::start(const FieldTable& serverProperties,
+ false ); // disallow interaction
+ }
+ std::string supportedMechanismsList;
+- bool requestedMechanismIsSupported = false;
+ Array::const_iterator i;
+
+ /*
+@@ -269,11 +268,9 @@ void ConnectionHandler::Handler::start(const FieldTable& serverProperties,
+ if (i != supportedMechanisms.begin())
+ supportedMechanismsList += SPACE;
+ supportedMechanismsList += (*i)->get<std::string>();
+- requestedMechanismIsSupported = true;
+ }
+ }
+ else {
+- requestedMechanismIsSupported = false;
+ /*
+ The caller has requested a mechanism. If it's available,
+ make sure it ends up at the head of the list.
+@@ -282,7 +279,6 @@ void ConnectionHandler::Handler::start(const FieldTable& serverProperties,
+ string currentMechanism = (*i)->get<std::string>();
+
+ if ( requestedMechanism == currentMechanism ) {
+- requestedMechanismIsSupported = true;
+ supportedMechanismsList = currentMechanism + SPACE + supportedMechanismsList;
+ } else {
+ if (i != supportedMechanisms.begin())
+diff --git a/qpid/cpp/src/qpid/broker/Daemon.cpp b/qpid/cpp/src/qpid/broker/Daemon.cpp
+index b30e5f1..c36538b 100644
+--- a/qpid/cpp/src/qpid/broker/Daemon.cpp
++++ b/qpid/cpp/src/qpid/broker/Daemon.cpp
+@@ -93,11 +93,10 @@ void Daemon::fork()
+ catch (const exception& e) {
+ QPID_LOG(critical, "Unexpected error: " << e.what());
+ uint16_t port = 0;
+- int unused_ret; //Supress warning about ignoring return value.
+- unused_ret = write(pipeFds[1], &port, sizeof(uint16_t));
++ (void) write(pipeFds[1], &port, sizeof(uint16_t));
+
+ std::string pipeFailureMessage = e.what();
+- unused_ret = write ( pipeFds[1],
++ (void) write ( pipeFds[1],
+ pipeFailureMessage.c_str(),
+ strlen(pipeFailureMessage.c_str())
+ );
+diff --git a/qpid/cpp/src/qpid/cluster/Cluster.cpp b/qpid/cpp/src/qpid/cluster/Cluster.cpp
+index a8a99d8..32ac12e 100644
+--- a/qpid/cpp/src/qpid/cluster/Cluster.cpp
++++ b/qpid/cpp/src/qpid/cluster/Cluster.cpp
+@@ -365,7 +365,8 @@ void Cluster::addShadowConnection(const boost::intrusive_ptr<Connection>& c) {
+ assert(discarding);
+ pair<ConnectionMap::iterator, bool> ib
+ = connections.insert(ConnectionMap::value_type(c->getId(), c));
+- assert(ib.second);
++ // Like this to avoid tripping up unused variable warning when NDEBUG set
++ if (!ib.second) assert(ib.second);
+ }
+
+ void Cluster::erase(const ConnectionId& id) {
+diff --git a/qpid/cpp/src/qpid/console/SessionManager.cpp b/qpid/cpp/src/qpid/console/SessionManager.cpp
+index 80c5959..910ae22 100644
+--- a/qpid/cpp/src/qpid/console/SessionManager.cpp
++++ b/qpid/cpp/src/qpid/console/SessionManager.cpp
+@@ -362,12 +362,11 @@ void SessionManager::handleCommandComplete(Broker* broker, Buffer& inBuffer, uin
+
+ void SessionManager::handleClassInd(Broker* broker, Buffer& inBuffer, uint32_t)
+ {
+- uint8_t kind;
+ string packageName;
+ string className;
+ uint8_t hash[16];
+
+- kind = inBuffer.getOctet();
++ /*kind*/ (void) inBuffer.getOctet();
+ inBuffer.getShortString(packageName);
+ inBuffer.getShortString(className);
+ inBuffer.getBin128(hash);
+diff --git a/qpid/cpp/src/qpid/sys/RdmaIOPlugin.cpp b/qpid/cpp/src/qpid/sys/RdmaIOPlugin.cpp
+index d53db20..d49f930 100644
+--- a/qpid/cpp/src/qpid/sys/RdmaIOPlugin.cpp
++++ b/qpid/cpp/src/qpid/sys/RdmaIOPlugin.cpp
+@@ -212,10 +212,9 @@ void RdmaIOHandler::readbuff(Rdma::AsynchIO&, Rdma::Buffer* buff) {
+ if (readError) {
+ return;
+ }
+- size_t decoded = 0;
+ try {
+ if (codec) {
+- decoded = codec->decode(buff->bytes(), buff->dataCount());
++ (void) codec->decode(buff->bytes(), buff->dataCount());
+ }else{
+ // Need to start protocol processing
+ initProtocolIn(buff);
+@@ -230,9 +229,7 @@ void RdmaIOHandler::readbuff(Rdma::AsynchIO&, Rdma::Buffer* buff) {
+ void RdmaIOHandler::initProtocolIn(Rdma::Buffer* buff) {
+ framing::Buffer in(buff->bytes(), buff->dataCount());
+ framing::ProtocolInitiation protocolInit;
+- size_t decoded = 0;
+ if (protocolInit.decode(in)) {
+- decoded = in.getPosition();
+ QPID_LOG(debug, "Rdma: RECV [" << identifier << "] INIT(" << protocolInit << ")");
+
+ codec = factory->create(protocolInit.getVersion(), *this, identifier, SecuritySettings());
+@@ -353,12 +350,6 @@ string RdmaIOProtocolFactory::getHost() const {
+ }
+
+ void RdmaIOProtocolFactory::accept(Poller::shared_ptr poller, ConnectionCodec::Factory* fact) {
+- ::sockaddr_in sin;
+-
+- sin.sin_family = AF_INET;
+- sin.sin_port = htons(listeningPort);
+- sin.sin_addr.s_addr = INADDR_ANY;
+-
+ listener.reset(
+ new Rdma::Listener(
+ Rdma::ConnectionParams(65536, Rdma::DEFAULT_WR_ENTRIES),
+diff --git a/qpid/cpp/src/qpid/sys/posix/LockFile.cpp b/qpid/cpp/src/qpid/sys/posix/LockFile.cpp
+index 1862ff6..f5a6c29 100755
+--- a/qpid/cpp/src/qpid/sys/posix/LockFile.cpp
++++ b/qpid/cpp/src/qpid/sys/posix/LockFile.cpp
+@@ -58,8 +58,7 @@ LockFile::~LockFile() {
+ if (impl) {
+ int f = impl->fd;
+ if (f >= 0) {
+- int unused_ret;
+- unused_ret = ::lockf(f, F_ULOCK, 0); // Suppress warnings about ignoring return value.
++ (void) ::lockf(f, F_ULOCK, 0); // Suppress warnings about ignoring return value.
+ ::close(f);
+ impl->fd = -1;
+ }
+diff --git a/qpid/cpp/src/tests/ForkedBroker.cpp b/qpid/cpp/src/tests/ForkedBroker.cpp
+index 53eaa7e..10674b5 100644
+--- a/qpid/cpp/src/tests/ForkedBroker.cpp
++++ b/qpid/cpp/src/tests/ForkedBroker.cpp
+@@ -68,8 +68,7 @@ ForkedBroker::~ForkedBroker() {
+ }
+ if (!dataDir.empty())
+ {
+- int unused_ret; // Suppress warnings about ignoring return value.
+- unused_ret = ::system(("rm -rf "+dataDir).c_str());
++ (void) ::system(("rm -rf "+dataDir).c_str());
+ }
+ }
+
More information about the scm-commits
mailing list