On 11/27/2011 06:14 AM, Fraser Adams wrote:
OK so I fixed that one by doing:

ssize_t unused; // Prevents ignoring return value of ‘ssize_t write..’, declared
with attribute warn_unused_result
unused = ::write.......

in Daemon.cpp

but it cropped up again in LockFile.cpp

I noticed

cc1plus: warnings being treated as errors
qpid/sys/posix/LockFile.cpp: In destructor ‘qpid::sys::LockFile::~LockFile()’:
qpid/sys/posix/LockFile.cpp:61: error: ignoring return value of ‘int lockf(int,
int, __off_t)’, declared with attribute warn_unused_result

So clearly it's bombing out due to warnings rather than "real errors". arguably
a good thing but.......

Seems like there may be some issues with the code base, but surely someone else
would have seen similar. Any reason why make on my box is treating warnings as
errors whereas that's (I assume) not happening with whoever packaged the distro.


You may be using a different compiler, even a different version of the same compiler can introduce errors like these. At one point I thought we fixed all of those but some may be re-introduced. Can you try this patch and see if it fixes the LogFile issue? If so open a JIRA assigned to me and attach whatever patches you need to get it working. I'll commit them.

diff --git a/qpid/cpp/src/qpid/sys/posix/LockFile.cpp b/qpid/cpp/src/qpid/sys/posix/LockFile.cpp
index f5a6c29..4249bcb 100755
--- a/qpid/cpp/src/qpid/sys/posix/LockFile.cpp
+++ b/qpid/cpp/src/qpid/sys/posix/LockFile.cpp
@@ -58,7 +58,8 @@ LockFile::~LockFile() {
     if (impl) {
         int f = impl->fd;
         if (f >= 0) {
-            (void) ::lockf(f, F_ULOCK, 0); // Suppress warnings about ignoring return value.
+            int ignore = ::lockf(f, F_ULOCK, 0); // Suppress warnings about ignoring return value.
+            (void)ignore;
             ::close(f);
             impl->fd = -1;
         }

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:[email protected]

Reply via email to