[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
patches to remove compiler warnings
From: |
Georg Soffel |
Subject: |
patches to remove compiler warnings |
Date: |
Thu, 5 Aug 2004 11:07:53 +0200 |
Dear all,
part of our code quality policy is to switch on as much compiler warnings
as possible.
In doing so I get unnecessary warnings from commoncpp:
/usr/local/include/cc++2/cc++/thread.h:499:7: warning: "HAVE_ATOMIC" is not
defined
/usr/local/include/cc++2/cc++/socket.h:1163: warning: unused parameter
`const ost::IPV4Host&ia'
/usr/local/include/cc++2/cc++/socket.h:1163: warning: unused parameter
`tpport_t port'
/usr/local/include/cc++2/cc++/socket.h:1562: warning: base class `
struct std::basic_ios<char, std::char_traits<char> >' should be
explicitly
initialized in the copy constructor
[this one here is special, I think it has nothing to do with commoncpp
itself, but is a problem the compiler (currently: gcc (GCC) 3.3)]
To get rid off all these warning here are the patches against
commoncpp2-1.2.4:
###### patch for thread.h #### cut here ######
--- thread_orig.h Thu Aug 5 10:08:29 2004
+++ thread.h Thu Aug 5 10:19:13 2004
@@ -496,7 +496,7 @@
private:
#ifdef HAVE_ATOMIC_AIX
volatile int counter;
-#elif HAVE_ATOMIC
+#elif defined HAVE_ATOMIC
atomic_t atomic;
#else
volatile int counter;
###### patch for thread.h #### cut here ######
###### patch for socket.h #### cut here ######
--- socket_orig.h Thu Aug 5 10:21:12 2004
+++ socket.h Thu Aug 5 10:24:25 2004
@@ -1159,7 +1159,7 @@
* @param ia internet host address of the client.
* @param port number of the client.
*/
- virtual bool onAccept(const IPV4Host &ia, tpport_t port)
+ virtual bool onAccept(const IPV4Host &, tpport_t)
{return true;}
friend class TCPStream;
@@ -1559,7 +1559,7 @@
{
public:
// copy constructor (fix a BUG in msvc7 compiler)
- tcpstream(const tcpstream &rhs):TCPStream(rhs) {};
+ tcpstream(const tcpstream &rhs);
/**
* Construct an unopened "tcpstream" object.
###### patch for socket.h #### cut here ######
###### patch for socket.cpp #### cut here ######
--- socket_orig.cpp Thu Aug 5 10:26:18 2004
+++ socket.cpp Thu Aug 5 10:27:53 2004
@@ -2000,6 +2000,11 @@
setError(false); /* no exceptions */
}
+tcpstream::tcpstream(const tcpstream &rhs) :
+TCPStream(rhs)
+{
+}
+
tcpstream::tcpstream(const char *addr, int buf) :
TCPStream()
{
###### patch for socket.cpp #### cut here ######
I would really appreciate if these patches find their way into commoncpp.
Regards,
Georg Soffel
- patches to remove compiler warnings,
Georg Soffel <=