Hi again,

The first attached patch fixes some compiler errors with GCC 4.3 due
to missing includes.  See "Header Dependency Cleanup" in
http://gcc.gnu.org/gcc-4.3/porting_to.html

The second fixes warnings with any version of GCC, caused by
initialising members in the wrong order in a constructor initialiser
list.  The standard says that memebrs will be initialised in the order
they're declared in the class body, not the order they appear in the
init list, so for clarity's sake the init list should be in the same
order.

Jonathan
Index: src/test/cpp/logunit.cpp
===================================================================
--- src/test/cpp/logunit.cpp	(revision 620195)
+++ src/test/cpp/logunit.cpp	(working copy)
@@ -21,6 +21,7 @@
 #include "logunit.h"
 
 #include <apr_general.h>
+#include <algorithm>
 
 void initialize() {
     apr_initialize();
Index: src/main/cpp/bytearrayoutputstream.cpp
===================================================================
--- src/main/cpp/bytearrayoutputstream.cpp	(revision 620195)
+++ src/main/cpp/bytearrayoutputstream.cpp	(working copy)
@@ -19,6 +19,7 @@
 #include <log4cxx/helpers/bytearrayoutputstream.h>
 #include <log4cxx/helpers/exception.h>
 #include <log4cxx/helpers/bytebuffer.h>
+#include <string.h>
 
 using namespace log4cxx;
 using namespace log4cxx::helpers;
Index: src/main/cpp/nameabbreviator.cpp
===================================================================
--- src/main/cpp/nameabbreviator.cpp	(revision 620195)
+++ src/main/cpp/nameabbreviator.cpp	(working copy)
@@ -19,6 +19,7 @@
 #include <log4cxx/helpers/exception.h>
 #include <log4cxx/helpers/stringhelper.h>
 #include <vector>
+#include <limits.h>
 
 using namespace log4cxx;
 using namespace log4cxx::pattern;
Index: src/examples/cpp/delayedloop.cpp
===================================================================
--- src/examples/cpp/delayedloop.cpp	(revision 620195)
+++ src/examples/cpp/delayedloop.cpp	(working copy)
@@ -23,6 +23,7 @@
 #include <iostream>
 #include <log4cxx/stream.h>
 #include <exception>
+#include <stdlib.h>
 
 using namespace log4cxx;
 using namespace log4cxx::helpers;
Index: src/main/cpp/smtpappender.cpp
===================================================================
--- src/main/cpp/smtpappender.cpp	(revision 620195)
+++ src/main/cpp/smtpappender.cpp	(working copy)
@@ -315,8 +315,8 @@
 }
 
 SMTPAppender::SMTPAppender()
-: bufferSize(512), locationInfo(false), cb(bufferSize),
-evaluator(new DefaultEvaluator()), smtpPort(25)
+: smtpPort(25), bufferSize(512), locationInfo(false), cb(bufferSize),
+evaluator(new DefaultEvaluator())
 {
 }
 
@@ -324,8 +324,8 @@
 Use <code>evaluator</code> passed as parameter as the
 TriggeringEventEvaluator for this SMTPAppender.  */
 SMTPAppender::SMTPAppender(spi::TriggeringEventEvaluatorPtr evaluator)
-: bufferSize(512), locationInfo(false), cb(bufferSize),
-evaluator(evaluator), smtpPort(25)
+: smtpPort(25), bufferSize(512), locationInfo(false), cb(bufferSize),
+evaluator(evaluator)
 {
 }
 
Index: src/main/cpp/propertyconfigurator.cpp
===================================================================
--- src/main/cpp/propertyconfigurator.cpp	(revision 620195)
+++ src/main/cpp/propertyconfigurator.cpp	(working copy)
@@ -74,7 +74,7 @@
 
 
 PropertyConfigurator::PropertyConfigurator()
-: loggerFactory(new DefaultLoggerFactory()), registry(new std::map<LogString, AppenderPtr>())
+: registry(new std::map<LogString, AppenderPtr>()), loggerFactory(new DefaultLoggerFactory())
 {
 }
 
Index: src/main/cpp/logstream.cpp
===================================================================
--- src/main/cpp/logstream.cpp	(revision 620195)
+++ src/main/cpp/logstream.cpp	(working copy)
@@ -43,7 +43,7 @@
 
 logstream_base::logstream_base(const LoggerPtr& log,
      const LevelPtr& lvl) : initset((std::ios_base::fmtflags) -1, 1), 
-     initclear((std::ios_base::fmtflags) 0, 0), logger(log), level(lvl), location(), fillchar(0), fillset(false) {
+     initclear((std::ios_base::fmtflags) 0, 0), fillchar(0), fillset(false), logger(log), level(lvl), location() {
      enabled = logger->isEnabledFor(level);
 }
 

Reply via email to