Kaynağa Gözat

Issue #135 - Use g++ -Wformat option to detect errors

Adds __attribute__(format) on some printf-like functions to allow g++ to
detect format errors. Fixes a number of format errors that were detected
as a result.

There are other ... functions outside jlib that should get similar
treatment, so I will not close issue #135 just yet...

Signed-off-by: Richard Chapman <rchapman@hpccsystems.com>
Richard Chapman 14 yıl önce
ebeveyn
işleme
38e69d7728
66 değiştirilmiş dosya ile 181 ekleme ve 160 silme
  1. 1 1
      cmake_modules/commonSetup.cmake
  2. 5 1
      common/fileview2/fvtransform.cpp
  3. 3 3
      common/remote/rmtsmtp.cpp
  4. 1 1
      common/remote/rmtspawn.cpp
  5. 5 5
      common/remote/sockfile.cpp
  6. 1 1
      common/roxiehelper/roxiedebug.cpp
  7. 2 2
      common/roxiehelper/roxiehelper.cpp
  8. 1 1
      common/roxiemanager/roxiewuprocessor.cpp
  9. 3 3
      common/thorhelper/thorsoapcall.cpp
  10. 5 5
      dali/base/dadfs.cpp
  11. 6 6
      dali/base/dasds.cpp
  12. 1 1
      dali/base/dasess.cpp
  13. 1 1
      dali/dafilesrv/dafilesrv.cpp
  14. 2 2
      dali/dalidiag/dalidiag.cpp
  15. 2 2
      dali/datest/datest.cpp
  16. 3 3
      dali/datest/dfuwutest.cpp
  17. 2 2
      dali/dfu/dfurepl.cpp
  18. 2 2
      dali/ft/daftdir.cpp
  19. 2 2
      dali/ft/daftformat.cpp
  20. 6 6
      dali/ft/filecopy.cpp
  21. 1 1
      dali/sasha/sacoalescer.cpp
  22. 1 1
      dali/sasha/sautil.hpp
  23. 8 8
      dali/sdsfix/sdsfix.cpp
  24. 2 2
      deployment/deploy/DeploymentEngine.cpp
  25. 1 1
      deployment/deploy/EspDeploymentEngine.cpp
  26. 1 1
      deployment/deploy/espconfiggenengine.cpp
  27. 2 2
      deployment/deployutils/deployutils.cpp
  28. 1 1
      ecl/agentexec/agentexec.cpp
  29. 1 1
      ecl/eclagent/eclagent.cpp
  30. 1 1
      ecl/hql/hqlexpr.cpp
  31. 1 1
      ecl/hql/hqlfold.cpp
  32. 1 1
      ecl/hqlcpp/hqlcerrors.hpp
  33. 1 1
      ecl/hqlcpp/hqlhtcpp.cpp
  34. 1 1
      ecl/hqlcpp/hqlstep.cpp
  35. 2 2
      ecl/hqlcpp/hqlttcpp.cpp
  36. 1 1
      ecl/hthor/hthor.cpp
  37. 1 1
      esp/services/WsDeploy/WsDeployService.cpp
  38. 1 1
      esp/services/ws_ecl/ws_ecl_json.cpp
  39. 1 1
      esp/services/ws_ecl/ws_ecl_service.cpp
  40. 1 1
      esp/services/ws_fs/ws_fsService.cpp
  41. 2 2
      esp/services/ws_smc/ws_smcService.cpp
  42. 5 5
      esp/services/ws_workunits/ws_workunitsService.cpp
  43. 4 4
      plugins/fileservices/fileservices.cpp
  44. 5 5
      roxie/ccd/ccdfile.cpp
  45. 1 1
      roxie/ccd/ccdkey.cpp
  46. 1 1
      roxie/ccd/ccdquery.cpp
  47. 5 5
      roxie/roxiemem/roxiemem.cpp
  48. 2 2
      roxie/udplib/udpsha.cpp
  49. 1 1
      roxie/udplib/uttest.cpp
  50. 1 1
      system/jhtree/ctfile.cpp
  51. 2 2
      system/jhtree/jhtree.cpp
  52. 1 1
      system/jlib/jbuff.cpp
  53. 1 1
      system/jlib/jdebug.cpp
  54. 6 6
      system/jlib/jexcept.cpp
  55. 8 8
      system/jlib/jexcept.hpp
  56. 3 3
      system/jlib/jfile.cpp
  57. 1 1
      system/jlib/jflz.cpp
  58. 36 19
      system/jlib/jlog.hpp
  59. 2 2
      system/jlib/jthread.cpp
  60. 1 1
      system/security/LdapSecurity/ldapconnection.cpp
  61. 2 2
      system/security/LdapSecurity/ldapconnection.hpp
  62. 1 1
      thorlcr/graph/thgraph.cpp
  63. 1 1
      thorlcr/thorutil/thalloc.cpp
  64. 1 1
      thorlcr/thorutil/thormisc.cpp
  65. 3 3
      tools/backupnode/backupnode.cpp
  66. 1 1
      tools/swapnode/swapnode.cpp

+ 1 - 1
cmake_modules/commonSetup.cmake

@@ -101,7 +101,7 @@ IF ("${COMMONSETUP_DONE}" STREQUAL "")
     set ( EXECUTABLE_OUTPUT_PATH "${CMAKE_BINARY_DIR}/${CMAKE_BUILD_TYPE}/bin" )
     set ( LIBRARY_OUTPUT_PATH "${CMAKE_BINARY_DIR}/${CMAKE_BUILD_TYPE}/libs" )
     if (${CMAKE_COMPILER_IS_GNUCXX})
-      SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -frtti -fPIC -fmessage-length=0")
+      SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -frtti -fPIC -fmessage-length=0 -Wformat -Werror")
       SET (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} --export-dynamic")
       SET (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -g -fno-default-inline -fno-inline-functions")
     endif ()

+ 5 - 1
common/fileview2/fvtransform.cpp

@@ -854,7 +854,11 @@ void MappingParser::parseAttribute(FieldTransformInfo & output)
         lexToken();
     }
     else
-        throwError1(FVERR_ExpectedX, "Definition name");
+    {
+        unsigned len = lenInput-offset;
+        if (len>10) len = 10;
+        throwError3(FVERR_ExpectedX, "Definition name", len, input+offset);
+    }
 }
 
 void MappingParser::parseColumnMapping(FieldTransformInfo & output)

+ 3 - 3
common/remote/rmtsmtp.cpp

@@ -289,7 +289,7 @@ private:
 
     void fail(char const * msg)
     {
-        throw MakeStringException(0, "bad %s (%s at character %u): %s", label, msg, finger-value, value);
+        throw MakeStringException(0, "bad %s (%s at character %u): %s", label, msg, (unsigned) (finger-value), value);
     }
 
     bool badAtomChar(char c)
@@ -635,7 +635,7 @@ public:
     CMailPart(char const * mimeType, char const * filename)
     {
         if(strlen(mimeTypeHeader) + strlen(mimeType) > 998)
-            throw MakeStringException(0, "Email attachment mime type too long: %u characters", strlen(mimeType));
+            throw MakeStringException(0, "Email attachment mime type too long: %u characters", (unsigned) strlen(mimeType));
         CSMTPValidator validator;
         validator.validateValue(mimeType, "email attachment mime type");
         mime.append(mimeType);
@@ -645,7 +645,7 @@ public:
             StringBuffer qfilename;
             validator.escapeQuoted(filename, qfilename, "email attachment filename");
             if(strlen(dispositionHeader) + strlen("attachment; filename=\"\"") + qfilename.length() > 998)
-                throw MakeStringException(0, "Email attachment filename too long: %u characters", strlen(filename));
+                throw MakeStringException(0, "Email attachment filename too long: %u characters", (unsigned) strlen(filename));
             disposition.append("attachment; filename=\"").append(qfilename.str()).append("\"");
         }
         else

+ 1 - 1
common/remote/rmtspawn.cpp

@@ -331,7 +331,7 @@ bool CRemoteParentInfo::sendReply(unsigned version)
                             //can remove when all .exes have new code.
                             if (connectKind != kind)
                             {
-                                LOG(MCdebugInfo(1000), unknownJob, "Connection for wrong slave kind - ignore", connectKind, kind);
+                                LOG(MCdebugInfo(1000), unknownJob, "Connection for wrong slave kind (%d vs %d)- ignore", connectKind, kind);
                                 replyVersion = connectVersion;
                             }
                         }

+ 5 - 5
common/remote/sockfile.cpp

@@ -874,7 +874,7 @@ static void treeCopyFile(RemoteFilename &srcfn, RemoteFilename &dstfn, const cha
             }
             // all locations busy
             if (msTick()-start>TREECOPYTIMEOUT) {
-                WARNLOG("Treecopy %s wait timed out");
+                WARNLOG("Treecopy %s wait timed out", srcfile->queryFilename());
                 break;
             }
             treeCopyWaiting++; // note this isn't precise - just indication
@@ -1935,7 +1935,7 @@ public:
         rfn.serialize(sendBuffer);
         const char *d = dest->queryFilename();
         if (!isAbsolutePath(d)) 
-            throw MakeStringException(-1,"treeCopyFile destination '%s' is not an absolute path");
+            throw MakeStringException(-1,"treeCopyFile destination '%s' is not an absolute path", d);
         rfn.setRemotePath(d);
         rfn.serialize(sendBuffer);
         StringBuffer tmp;
@@ -2987,7 +2987,7 @@ class CRemoteFileServer : public CInterface, implements IRemoteFileServer, imple
             if (TF_TRACE_FULL)
                 PROGLOG("notifySelected %d,%d",toread,left);
             if ((left!=0)&&(avail==0)) {
-                WARNLOG("notifySelected: Closing mid packet, %d remaining");
+                WARNLOG("notifySelected: Closing mid packet, %d remaining", left);
                 toread = left;
                 buf.clear();
             }
@@ -3828,7 +3828,7 @@ public:
         }
 
         if (TF_TRACE)
-            PROGLOG("GetDir,  '%s'",name.get(),mask.get());
+            PROGLOG("GetDir,  '%s', '%s'",name.get(),mask.get());
         try {
             Owned<IFile> dir=createIFile(name);
 
@@ -3883,7 +3883,7 @@ public:
             prev.setown(di);
         }
         if (TF_TRACE)
-            PROGLOG("MonitorDir,  '%s'",name.get(),mask.get());
+            PROGLOG("MonitorDir,  '%s' '%s'",name.get(),mask.get());
         try {
             Owned<IFile> dir=createIFile(name);
             Owned<IDirectoryDifferenceIterator> iter=dir->monitorDirectory(prev,mask.length()?mask.get():NULL,sub,includedir,checkinterval,timeout);

+ 1 - 1
common/roxiehelper/roxiedebug.cpp

@@ -1193,7 +1193,7 @@ BreakpointActionMode CBaseDebugContext::checkBreakpoint(DebugState state, IActiv
         running = false;
         currentState = state;
         if (currentActivity)
-            logctx.CTXLOG("DEBUG: paused waiting for debugger, state %s, edge %d", queryStateString(state), currentActivity->queryEdgeId());
+            logctx.CTXLOG("DEBUG: paused waiting for debugger, state %s, edge %s", queryStateString(state), currentActivity->queryEdgeId());
         else
             logctx.CTXLOG("DEBUG: paused waiting for debugger, state %s, edge '(none)'", queryStateString(state));
         if (debuggerActive) // Was the debugger actively waiting for the program to hit a breakpoint?

+ 2 - 2
common/roxiehelper/roxiehelper.cpp

@@ -930,9 +930,9 @@ void FlushingStringBuffer::flushXML(StringBuffer &current, bool isClosing)
                 logctx.CTXLOG("Sending reply: Sending blocked %s data", (isXml)?"xml":"raw");
             else
 #ifdef _DEBUG
-                logctx.CTXLOG("Sending reply length %d: %.1024s", s.length() - sizeof(size32_t), s.str()+sizeof(size32_t));
+                logctx.CTXLOG("Sending reply length %d: %.1024s", (unsigned) (s.length() - sizeof(size32_t)), s.str()+sizeof(size32_t));
 #else
-                logctx.CTXLOG("Sending reply length %d: %.40s", s.length() - sizeof(size32_t), s.str()+sizeof(size32_t));
+                logctx.CTXLOG("Sending reply length %d: %.40s", (unsigned) (s.length() - sizeof(size32_t)), s.str()+sizeof(size32_t));
 #endif
         }
         *(size32_t *) s.str() = revLen;

+ 1 - 1
common/roxiemanager/roxiewuprocessor.cpp

@@ -423,7 +423,7 @@ private:
                 if (baseIndexName.length())
                 {
                     if (useSourceClusterName)
-                        fullBaseIndexName.appendf("~%s::s",processingInfo.querySourceRoxieClusterName(), baseIndexName.str());
+                        fullBaseIndexName.appendf("~%s::%s",processingInfo.querySourceRoxieClusterName(), baseIndexName.str());
                     else
                         fullBaseIndexName.appendf("~%s", baseIndexName.str());
 

+ 3 - 3
common/thorhelper/thorsoapcall.cpp

@@ -1666,7 +1666,7 @@ private:
     inline void checkTimeLimitExceeded()
     {
         if (master->isTimeLimitExceeded())
-            throw MakeStringException(TIMELIMIT_EXCEEDED, "%sCALL TIMELIMIT(%d) exceeded", master->wscType == STsoap ? "SOAP" : "HTTP", master->timeLimit);
+            throw MakeStringException(TIMELIMIT_EXCEEDED, "%sCALL TIMELIMIT(%"I64F"u) exceeded", master->wscType == STsoap ? "SOAP" : "HTTP", (unsigned __int64) master->timeLimit);
     }
 
 public:
@@ -1742,7 +1742,7 @@ public:
                 {
                     if (master->timeLimitExceeded)
                     {
-                        master->logctx.CTXLOG("%sCALL exiting: time limit (%d) exceeded",master->wscType == STsoap ? "SOAP" : "HTTP", master->timeLimit);
+                        master->logctx.CTXLOG("%sCALL exiting: time limit (%"I64F"d) exceeded",master->wscType == STsoap ? "SOAP" : "HTTP", (unsigned __int64) master->timeLimit);
                         processException(url, inputRows, e);
                         return;
                     }
@@ -1840,7 +1840,7 @@ public:
                 if (master->timeLimitExceeded)
                 {
                     processException(url, inputRows, e);
-                    master->logctx.CTXLOG("%sCALL exiting: time limit (%d) exceeded",master->wscType == STsoap ? "SOAP" : "HTTP",master->timeLimit);
+                    master->logctx.CTXLOG("%sCALL exiting: time limit (%"I64F"d) exceeded", master->wscType == STsoap ? "SOAP" : "HTTP", (unsigned __int64) master->timeLimit);
                     break;
                 }
 

+ 5 - 5
dali/base/dadfs.cpp

@@ -6774,7 +6774,7 @@ bool CDistributedFileDirectory::cannotRemove(CDfsLogicalFileName &dlfn,IProperty
     const char *logicalname = dlfn.get();
     if (!checkprotonly) {
         if (!logicalname||!*logicalname) {
-            reason.appendf("empty filename",logicalname);
+            reason.appendf("empty filename");
             return true;
         }
         if (dlfn.isQuery()) {
@@ -6854,7 +6854,7 @@ bool CDistributedFileDirectory::doRemoveEntry(CDfsLogicalFileName &dlfn,IUserDes
         }
         if (cname.length()) {
             if (bkind==DXB_SuperFile) {
-                ERRLOG("Trying to remove cluster %s from superfile %s",logicalname);
+                ERRLOG("Trying to remove cluster %s from superfile %s",logicalname,cname.str());
                 return false;
             }
             const char *group = froot->queryProp("@group"); 
@@ -6866,7 +6866,7 @@ bool CDistributedFileDirectory::doRemoveEntry(CDfsLogicalFileName &dlfn,IUserDes
                     return froot->removeTree(t);    
                 }
                 else {
-                    ERRLOG("Cluster %s not present in file %s",logicalname);
+                    ERRLOG("Cluster %s not present in file %s",logicalname,cname.str());
                     return false;
                 }
             }           
@@ -7021,7 +7021,7 @@ bool CDistributedFileDirectory::renamePhysical(const char *oldname,const char *n
     if (newfile) {
         if (newcluster.length()) {
             if (oldcluster.length()) 
-                throw MakeStringException(-1,"cannot specify both source and destination clusters on rename",oldname);
+                throw MakeStringException(-1,"cannot specify both source and destination clusters on rename");
             if (newfile->findCluster(newcluster.str())!=NotFound) 
                 throw MakeStringException(-1,"renamePhysical cluster %s already part of file %s",newcluster.str(),newname);
             if (file->numClusters()!=1) 
@@ -7037,7 +7037,7 @@ bool CDistributedFileDirectory::renamePhysical(const char *oldname,const char *n
     }
     else if (oldcluster.length()) {
         if (newcluster.length()) 
-            throw MakeStringException(-1,"cannot specify both source and destination clusters on rename",oldname);
+            throw MakeStringException(-1,"cannot specify both source and destination clusters on rename");
         if (file->numClusters()==1) 
             throw MakeStringException(-1,"cannot rename sole cluster %s",oldcluster.str());
         if (file->findCluster(oldcluster.str())==NotFound) 

+ 6 - 6
dali/base/dasds.cpp

@@ -4102,7 +4102,7 @@ void CSDSTransactionServer::processMessage(CMessageBuffer &mb)
                 if (TransactionLogging)
                 {
                     CServerConnection *conn = manager.queryConnection(connectionId);
-                    PROGLOG(">>> DAMP_SDSCMD_DATA",conn?conn->queryXPath():"???");
+                    PROGLOG(">>> DAMP_SDSCMD_DATA %s",conn?conn->queryXPath():"???");
                 }
                 byte disconnect; // kludge, high bit to indicate new client format. (for backward compat.)
                 bool deleteRoot;
@@ -4175,7 +4175,7 @@ void CSDSTransactionServer::processMessage(CMessageBuffer &mb)
                 if (TransactionLogging)
                 {
                     CServerConnection *conn = manager.queryConnection(connectionId);
-                    PROGLOG(">>> DAMP_SDSCMD_CHANGEMODE",conn?conn->queryXPath():"???");
+                    PROGLOG(">>> DAMP_SDSCMD_CHANGEMODE %s",conn?conn->queryXPath():"???");
                 }   
                 CHECKEDDALIWRITELOCKBLOCK(manager.dataRWLock, readWriteTimeout);
                 Linked<CServerConnection> connection = manager.queryConnection(connectionId);
@@ -4209,7 +4209,7 @@ void CSDSTransactionServer::processMessage(CMessageBuffer &mb)
                 mb.read(xpath);
                 if (TransactionLogging)
                 {
-                    PROGLOG(">>> DAMP_SDSCMD_GETXPATHS",xpath.get()?xpath.get():"???");
+                    PROGLOG(">>> DAMP_SDSCMD_GETXPATHS %s",xpath.get()?xpath.get():"???");
                 }
                 mb.clear();
                 Owned<IPropertyTree> matchTree = SDSManager->getXPaths(serverId, xpath, DAMP_SDSCMD_GETXPATHSPLUSIDS==action);
@@ -4231,7 +4231,7 @@ void CSDSTransactionServer::processMessage(CMessageBuffer &mb)
                 mb.read(xpath);
                 if (TransactionLogging)
                 {
-                    PROGLOG(">>> DAMP_SDSCMD_GETXPATHSCRITERIA",xpath.get()?xpath.get():"???");
+                    PROGLOG(">>> DAMP_SDSCMD_GETXPATHSCRITERIA %s",xpath.get()?xpath.get():"???");
                 }
                 mb.read(matchXPath);
                 mb.read(sortBy);
@@ -4265,7 +4265,7 @@ void CSDSTransactionServer::processMessage(CMessageBuffer &mb)
                 mb.read(_xpath);
                 if (TransactionLogging)
                 {
-                    PROGLOG(">>> DAMP_SDSCMD_GETELEMENTSRAW",xpath.get()?xpath.get():"???");
+                    PROGLOG(">>> DAMP_SDSCMD_GETELEMENTSRAW %s",xpath.get()?xpath.get():"???");
                 }
                 CMessageBuffer replyMb;
                 replyMb.init(mb.getSender(), mb.getTag(), mb.getReplyTag());
@@ -6451,7 +6451,7 @@ bool CCovenSDSManager::setSDSDebug(StringArray &params, StringBuffer &reply)
         unsigned ms = atoi(params.item(1));
         readWriteTimeout = ms;
 
-        PROGLOG("datalock, readWriteTimeout timing set to %d", readWriteStackTracing?"on":"off");
+        PROGLOG("datalock, readWriteTimeout timing set to %s", readWriteStackTracing?"on":"off");
     }
     else if (0 == stricmp("fakecritTiming", params.item(0)))
     {

+ 1 - 1
dali/base/dasess.cpp

@@ -1212,7 +1212,7 @@ public:
                     if (first50==0)
                         first50 = msTick();
                     else if (msTick()-first50>60*1000) {
-                        LOG(MCoperatorError, unknownJob, "LDAP stalled - aborting (returning 0 for %s)"); 
+                        LOG(MCoperatorError, unknownJob, "LDAP stalled - aborting (returning 0 for %s)", obj); 
                         if (err)
                             *err = CLDAPE_getpermtimeout;
                         break;

+ 1 - 1
dali/dafilesrv/dafilesrv.cpp

@@ -295,7 +295,7 @@ bool uninstallService(const char *servicename,const char *servicedisplayname)
 
 void sighandler(int signum, siginfo_t *info, void *extra) 
 {
-    PROGLOG("Caught signal %d, %x", signum, info?info->si_addr:0);
+    PROGLOG("Caught signal %d, %p", signum, info?info->si_addr:0);
     if (server)
         server->stop();
 }

+ 2 - 2
dali/dalidiag/dalidiag.cpp

@@ -289,7 +289,7 @@ void partInfo(const char *name,unsigned copy)
         }
     }
     else
-        DBGLOG("ERROR: %s not found");
+        DBGLOG("ERROR: %s not found", name);
 }
 
 
@@ -373,7 +373,7 @@ void backupList(const char *cluster)
         }
     }
     else 
-        DBGLOG("ERROR: cluster %s not found");
+        DBGLOG("ERROR: cluster %s not found", cluster);
 }
 
 void filePermissions(const char *lname,const char *username,const char *password)

+ 2 - 2
dali/datest/datest.cpp

@@ -659,7 +659,7 @@ void Test_MultiFile()
             RemoteMultiFilename rmfn;
             fdesc->getMultiFilename(p,cpy,rmfn);
             bool iswild = rmfn.isWild();
-            printf("Part %d[%d]%s\n",p+1,cpy,fdesc->isMulti(p)?", MULTI":"",iswild?", WILD":"");
+            printf("Part %d[%d]%s%s\n",p+1,cpy,fdesc->isMulti(p)?", MULTI":"",iswild?", WILD":"");
             unsigned nc = rmfn.ordinality();
             StringBuffer rfns;
             for (unsigned j=0;j<nc;j++) {
@@ -2976,4 +2976,4 @@ int main(int argc, char* argv[])
     catch (...) { if (!TEST("RANDTEST")) throw; }
     
     return 0;
-}
+}

+ 3 - 3
dali/datest/dfuwutest.cpp

@@ -48,7 +48,7 @@ void testAbort(const char *wuid)
         wu->requestAbort();
     }
     else
-        ERRLOG("WUID %s not found");
+        ERRLOG("WUID %s not found", wuid);
 }
 
 StringBuffer& constructFileMask(const char* filename, StringBuffer& filemask)
@@ -551,7 +551,7 @@ void testRoxieCopies()
         destination->setNumPartsOverride(np);
         destination->setWrap(true); //??
 #endif
-        PROGLOG("%d:A======================");
+        PROGLOG("A======================");
         StringBuffer buf;
         wu->toXML(buf);
         PROGLOG("\n%s",buf.str());
@@ -686,7 +686,7 @@ void testDFUwuqueue(const char *name)
         const char *wuid = wulist.item(i).text.get();
         Owned<IConstDFUWorkUnit> wu = getDFUWorkUnitFactory()->openWorkUnit(wuid,false);
         if (wu) 
-            PROGLOG("%s: %s,%s,%s,%s",wuid,i<running?"Running":"Queued",
+            PROGLOG("%s: %s,%s,%s,%s,%s",wuid,i<running?"Running":"Queued",
               encodeDFUcommand(wu->getCommand(),cmd.clear()).str(),
               wu->getClusterName(cname.clear()).str(),
               wu->getUser(uname.clear()).str(),

+ 2 - 2
dali/dfu/dfurepl.cpp

@@ -274,7 +274,7 @@ struct ReplicateFileItem: extends CInterface
         // see if already replicating
         Owned<IRemoteConnection> pconn = querySDS().connect("DFU/Replicating", myProcessSession(), RTM_LOCK_WRITE|RTM_CREATE_QUERY,  SDS_TIMEOUT);
         if (!pconn.get()) {
-            ERRLOG(LOGPFX "Connect to DFU/Replicating failed",lfn);
+            ERRLOG(LOGPFX "Connect to DFU/Replicating %s failed",lfn);
             return;
         }
         StringBuffer xpath;
@@ -294,7 +294,7 @@ struct ReplicateFileItem: extends CInterface
         // now as long as SDS doesn't lock children this should be OK
         conn.setown(querySDS().connect("DFU/Replicating/File", myProcessSession(), RTM_CREATE_ADD | RTM_LOCK_READ, 5*60*1000));
         if (!conn.get()) {
-            ERRLOG(LOGPFX "Create of DFU/Replicating/File failed",lfn);
+            ERRLOG(LOGPFX "Create of DFU/Replicating/File %s failed",lfn);
             return;
         }
         genUUID(tmp.clear(),true);  // true for windows

+ 2 - 2
dali/ft/daftdir.cpp

@@ -450,7 +450,7 @@ bool DirectoryThread::performCommand()
     if (!canSpawnChildProcess(node->endpoint()))
         throwError(DFTERR_NoSolarisDir);
 
-    LOG(MCdebugProgressDetail, job, "Starting to generate part %s [%lx]", url.str(), this);
+    LOG(MCdebugProgressDetail, job, "Starting to generate part %s [%p]", url.str(), this);
     StringBuffer tmp;
     Owned<ISocket> socket = spawnRemoteChild(SPAWNdfu, queryFtSlaveExecutable(node->endpoint(), tmp), node->endpoint(), DAFT_VERSION, queryFtSlaveLogDir(), NULL, NULL);
     if (socket)
@@ -505,7 +505,7 @@ bool DirectoryThread::performCommand()
     {
         throwError1(DFTERR_FailedStartSlave, url.str());
     }
-    LOG(MCdebugProgressDetail, job, "Completed generating part %s [%lx]", url.str(), this);
+    LOG(MCdebugProgressDetail, job, "Completed generating part %s [%p]", url.str(), this);
 
     return ok;
 }

+ 2 - 2
dali/ft/daftformat.cpp

@@ -605,7 +605,7 @@ size32_t CCsvPartitioner::getSplitRecordSize(const byte * start, unsigned maxToR
     }
     if (!ateof)
         throwError(DFTERR_EndOfRecordNotFound);
-    LOG(MCdebugProgress, unknownJob, "CSV splitRecordSize(%d) at end of file",end - start);
+    LOG(MCdebugProgress, unknownJob, "CSV splitRecordSize(%d) at end of file", (unsigned) (end - start));
     return end - start;
 }
 
@@ -739,7 +739,7 @@ size32_t CUtfPartitioner::getSplitRecordSize(const byte * start, unsigned maxToR
 
     if (!ateof)
         throwError(DFTERR_EndOfRecordNotFound);
-    LOG(MCdebugProgress, unknownJob, "UTF splitRecordSize(%d) at end of file",end - start);
+    LOG(MCdebugProgress, unknownJob, "UTF splitRecordSize(%d) at end of file", (unsigned) (end - start));
 
     return end - start;
 }

+ 6 - 6
dali/ft/filecopy.cpp

@@ -279,7 +279,7 @@ bool FileTransferThread::performTransfer()
     StringBuffer url;
     ep.getUrlStr(url);
 
-    LOG(MCdebugProgress, job, "Transferring part %s [%lx]", url.str(), this);
+    LOG(MCdebugProgress, job, "Transferring part %s [%p]", url.str(), this);
     started = true;
     allDone = true;
     if (sprayer.isSafeMode || action == FTactionpush)
@@ -309,17 +309,17 @@ bool FileTransferThread::performTransfer()
 
     if (allDone)
     {
-        LOG(MCdebugInfo, job, "Creation of part %s already completed\n", url.str());
+        LOG(MCdebugInfo, job, "Creation of part %s already completed", url.str());
         return true;
     }
 
     if (partition.empty())
     {
-        LOG(MCdebugInfo, job, "No elements to transfer for this slave\n", url.str());
+        LOG(MCdebugInfo, job, "No elements to transfer for this slave");
         return true;
     }
 
-    LOG(MCdebugProgressDetail, job, "Start generate part %s [%lx]", url.str(), this);
+    LOG(MCdebugProgressDetail, job, "Start generate part %s [%p]", url.str(), this);
     StringBuffer tmp;
     Owned<ISocket> socket = spawnRemoteChild(SPAWNdfu, sprayer.querySlaveExecutable(ep, tmp), ep, DAFT_VERSION, queryFtSlaveLogDir(), this, wuid);
     if (socket)
@@ -389,7 +389,7 @@ bool FileTransferThread::performTransfer()
         msg.read(ok);
         setErrorOwn(deserializeException(msg));
 
-        LOG(MCdebugProgressDetail, job, "Finished generating part %s [%lx] ok(%d) error(%d)", url.str(), this, (int)ok, (int)(error!=NULL));
+        LOG(MCdebugProgressDetail, job, "Finished generating part %s [%p] ok(%d) error(%d)", url.str(), this, (int)ok, (int)(error!=NULL));
 
         msg.clear().append(true);
         catchWriteBuffer(socket, msg);
@@ -400,7 +400,7 @@ bool FileTransferThread::performTransfer()
     {
         throwError1(DFTERR_FailedStartSlave, url.str());
     }
-    LOG(MCdebugProgressDetail, job, "Stopped generate part %s [%lx]", url.str(), this);
+    LOG(MCdebugProgressDetail, job, "Stopped generate part %s [%p]", url.str(), this);
 
     allDone = true;
     return ok;

+ 1 - 1
dali/sasha/sacoalescer.cpp

@@ -52,7 +52,7 @@ void coalesceDatastore(bool force)
         offset_t minDeltaSize = force?0:coalesceProps->getPropInt64("@minDeltaSize", DEFAULT_MINDELTASIZE);
 
         loop {
-            PROGLOG("COALESCER: dataPath=%s, backupPath=%s, minDeltaSize = %dK", dataPath.str(), backupPath.str(), minDeltaSize);
+            PROGLOG("COALESCER: dataPath=%s, backupPath=%s, minDeltaSize = %"I64F"dK", dataPath.str(), backupPath.str(), (unsigned __int64) minDeltaSize);
             unsigned configFlags = SH_External|SH_CheckNewDelta;
             configFlags |= coalesceProps->getPropBool("@recoverFromIncErrors", false) ? SH_RecoverFromIncErrors : 0;
             configFlags |= coalesceProps->getPropBool("@backupErrorFiles", true) ? SH_BackupErrorFiles : 0;

+ 1 - 1
dali/sasha/sautil.hpp

@@ -112,7 +112,7 @@ public:
             }
             if (maxduration) {
                 if (msTick()-start>maxduration) {
-                    PROGLOG("Maximum duration (%d) exceeded");
+                    PROGLOG("Maximum duration (%d) exceeded", maxduration);
                     return false;
                 }
             }

+ 8 - 8
dali/sdsfix/sdsfix.cpp

@@ -522,7 +522,7 @@ IPropertyTree *getCachedFileTree(const char *lname,const INode *foreigndali,IUse
     cachename.append("::").append(lfn.get());
     Owned<IRemoteConnection> conn = querySDS().connect(cachename,myProcessSession(),RTM_CREATE_QUERY|RTM_LOCK_WRITE, timeout);
     if (!conn) 
-        throw MakeStringException(DFSERR_ForeignDaliTimeout, "getFileTree: Timeout connecting to ", cachename.str());
+        throw MakeStringException(DFSERR_ForeignDaliTimeout, "getFileTree: Timeout connecting to %s", cachename.str());
 
     MemoryBuffer mb;
     IPropertyTree &root = *conn->queryRoot();
@@ -1822,7 +1822,7 @@ void import(const char *path,const char *src,bool add)
             Owned<IPropertyTree> broot = bconn->getRoot();
             StringBuffer bakname(src);
             bakname.append(".bak");
-            DBGLOG("Saving backup of %s to %s",path,tail,bakname.str());
+            DBGLOG("Saving backup of %s%s to %s",path,tail,bakname.str());
             Owned<IFile> f = createIFile(bakname.str());
             Owned<IFileIO> io = f->open(IFOcreate);
             Owned<IFileIOStream> fstream = createBufferedIOStream(io);
@@ -1883,7 +1883,7 @@ void bimport(const char *path,const char *src,bool add)
             Owned<IPropertyTree> broot = bconn->getRoot();
             StringBuffer bakname(src);
             bakname.append(".bak");
-            DBGLOG("Saving backup of %s to %s",path,tail,bakname.str());
+            DBGLOG("Saving backup of %s%s to %s",path,tail,bakname.str());
             Owned<IFile> f = createIFile(bakname.str());
             Owned<IFileIO> io = f->open(IFOcreate);
             Owned<IFileIOStream> fstream = createBufferedIOStream(io);
@@ -4536,7 +4536,7 @@ IPropertyTree *getFileTree(const char *lname,const INode *foreigndali,IUserDescr
     cachename.append("::").append(lfn.get());
     Owned<IRemoteConnection> conn = querySDS().connect(cachename,myProcessSession(),RTM_CREATE_QUERY|RTM_LOCK_WRITE, timeout);
     if (!conn) 
-        throw MakeStringException(DFSERR_ForeignDaliTimeout, "getFileTree: Timeout connecting to ", cachename.str());
+        throw MakeStringException(DFSERR_ForeignDaliTimeout, "getFileTree: Timeout connecting to %s", cachename.str());
 
     MemoryBuffer mb;
     IPropertyTree &root = *conn->queryRoot();
@@ -5129,12 +5129,12 @@ public:
     IMPLEMENT_IINTERFACE;
     bool take(memsize_t tot)
     {
-        PROGLOG("take %d",tot);
+        PROGLOG("take %"I64F"u", (unsigned __int64) tot);
         return true;
     }
     void give(memsize_t tot)
     {
-        PROGLOG("take %d",tot);
+        PROGLOG("take %"I64F"u", (unsigned __int64) tot);
     }
 };
 
@@ -5635,7 +5635,7 @@ void XMLcheckfix(IPropertyTree &tree,StringBuffer &path,const char *name,const c
         return;
     StringBuffer compressedout;
     if (compressRepeatedEscape(value,compressedout)) {
-        PROGLOG("%s%s from %d to %d '%s'",path.str(),name,strlen(value),compressedout.length(),compressedout.str());
+        PROGLOG("%s%s from %d to %d '%s'",path.str(),name,(int)strlen(value),compressedout.length(),compressedout.str());
         if (fix||check) {
             try {
                 Owned<IRemoteConnection> conn = querySDS().connect(path.str(), myProcessSession(), 0, 5*60*1000);  
@@ -5712,7 +5712,7 @@ void testLock(const char *lock,bool read)
 {
     Owned<IRemoteConnection> conn = querySDS().connect(lock,myProcessSession(),read?RTM_LOCK_READ:RTM_LOCK_WRITE, 1000*60);
     if (!conn) 
-        throw MakeStringException(DFSERR_ForeignDaliTimeout, "testLock: Timeout connecting to ", lock);
+        throw MakeStringException(DFSERR_ForeignDaliTimeout, "testLock: Timeout connecting to %s", lock);
     Sleep(1000*60*10);
 }
 

+ 2 - 2
deployment/deploy/DeploymentEngine.cpp

@@ -1152,7 +1152,7 @@ void CDeploymentEngine::connectToNetworkPath(const char* uncPath, const char* us
 
     // No sense in continuing if connection falied
     if (task->getErrorCode() != 0)
-        throw MakeStringException(0, ""); //message already displayed!
+        throw MakeStringException(0, "%s", ""); //message already displayed!
 
     // Save connections for disconnecting during destructor
     m_connections.insert( path.str() );
@@ -2574,4 +2574,4 @@ bool CDeploymentEngine::checkSSHFileExists(const char* dir) const
   }
 
   return flag;
-}
+}

+ 1 - 1
deployment/deploy/EspDeploymentEngine.cpp

@@ -113,7 +113,7 @@ int CEspDeploymentEngine::determineInstallFiles(IPropertyTree& node, CInstallFil
 
       const char* pszBuild = pService->queryProp("@build");
       if (!pszBuild || 0 != strcmp(pszBuild, myBuild))
-         throw MakeStringException(0, "ESP service '%s' used by ESP process '%s'\n has a different build than its ESP process!", 
+         throw MakeStringException(0, "ESP service '%s' used by ESP process '%s'\n has a different build (%s) to its ESP process!", 
                                    szService, m_name.get(), pszBuild);
 
          // Get plugin file list from the plugin process

+ 1 - 1
deployment/deploy/espconfiggenengine.cpp

@@ -114,7 +114,7 @@ int CEspConfigGenEngine::determineInstallFiles(IPropertyTree& node, CInstallFile
 
       const char* pszBuild = pService->queryProp("@build");
       if (!pszBuild || 0 != strcmp(pszBuild, myBuild))
-         throw MakeStringException(0, "ESP service '%s' used by ESP process '%s'\n has a different build than its ESP process!", 
+         throw MakeStringException(0, "ESP service '%s' used by ESP process '%s'\n has a different build (%s) to its ESP process!", 
                                    szService, m_name.get(), pszBuild);
 
          // Get plugin file list from the plugin process

+ 2 - 2
deployment/deployutils/deployutils.cpp

@@ -337,7 +337,7 @@ void addItem(StringBuffer& jsStrBuf,
   jsStrBuf.appendf("attr%s%s.tab = '%s';", attrName, tabName, *tabName ? getRealTabName(tabName): sbAttr.str());
   jsStrBuf.appendf("attr%s%s.tip = '%s';", attrName, tabName, tip);
   jsStrBuf.appendf("attr%s%s.hidden = %d;", attrName, tabName, hidden);
-  jsStrBuf.appendf("attr%s%s.required = 1;", attrName, tabName, required);
+  jsStrBuf.appendf("attr%s%s.required = 1;", attrName, tabName);
   jsStrBuf.appendf("attr%s%s.ctrlType = %d;", attrName, tabName, ctrlType);
   jsStrBuf.appendf("cS['%s%s']=attr%s%s;", attrName, tabName, attrName, tabName);
 
@@ -360,7 +360,7 @@ void addTopologyType(StringBuffer& jsStrBuf, const IPropertyTree* pEnv, const ch
   jsStrBuf.appendf("attr%s%s.tab = '%s';", attrName, tabName, "Topology");
   jsStrBuf.appendf("attr%s%s.tip = '%s';", attrName, tabName, tip);
   jsStrBuf.appendf("attr%s%s.hidden = %d;", attrName, tabName, hidden);
-  jsStrBuf.appendf("attr%s%s.required = 1;", attrName, tabName, required);
+  jsStrBuf.appendf("attr%s%s.required = 1;", attrName, tabName);
   jsStrBuf.appendf("attr%s%s.ctrlType = %d;", attrName, tabName, ctrlType);
   jsStrBuf.appendf("cS['%s%s']=attr%s%s;", attrName, tabName, attrName, tabName);
 

+ 1 - 1
ecl/agentexec/agentexec.cpp

@@ -226,7 +226,7 @@ int CEclAgentExecutionServer::executeWorkunit(const char * wuid)
     if (success)
     { 
         if (runcode != 0)
-            PROGLOG("Process failed during execution: %s error(%i)", cmdLine.str(), runcode);
+            PROGLOG("Process failed during execution: %s error(%"I64F"i)", cmdLine.str(), (unsigned __int64) runcode);
         else
             PROGLOG("Execution started");
     }

+ 1 - 1
ecl/eclagent/eclagent.cpp

@@ -2476,7 +2476,7 @@ void EclAgent::getPersistReadLock(const char * logicalName)
     StringBuffer lfn;
     expandLogicalName(lfn, logicalName);
     if (!lfn.length())
-        throw MakeStringException(0, "Invalid persist name used : '%'", logicalName);
+        throw MakeStringException(0, "Invalid persist name used : '%s'", logicalName);
 
     const char * name = lfn;
 

+ 1 - 1
ecl/hql/hqlexpr.cpp

@@ -6373,7 +6373,7 @@ void CFileContents::ensureUtf8(MemoryBuffer & contents)
         if (convertToUtf8(translated, contents.length(), contents.bufferBase()))
             contents.swapWith(translated);
         else
-            throw MakeStringException(1, "File doesn't appear to be UTF8", file->queryFilename());
+            throw MakeStringException(1, "File %s doesn't appear to be UTF8", file->queryFilename());
     }
 }
 

+ 1 - 1
ecl/hql/hqlfold.cpp

@@ -3608,7 +3608,7 @@ IHqlExpression * NullFolderMixin::foldNullDataset(IHqlExpression * expr)
                         return LINK(lastInput);
                     }
                 default:
-                    DBGLOG("Folder: Remove %d inputs from", expr->numChildren()-args.ordinality(), getOpString(op));
+                    DBGLOG("Folder: Remove %d inputs from %s", expr->numChildren()-args.ordinality(), getOpString(op));
                     return expr->clone(args);
                 }
             }

+ 1 - 1
ecl/hqlcpp/hqlcerrors.hpp

@@ -469,7 +469,7 @@
 #define HQLERR_CouldNotFindDataset_Text         "Could not find dataset %s"
 #define HQLERR_CouldNotAnyDatasetX_Text         "Could not find dataset %s (no tables in scope)"
 #define HQLERR_NestedThorNodes_Text             "INTERNAL: Thor nodes should not be nested"
-#define HQLERR_MissingTransformAssignXX_Text    "INTERNAL: Missing assignment from transform to %s[%lx]"
+#define HQLERR_MissingTransformAssignXX_Text    "INTERNAL: Missing assignment from transform to %s[%p]"
 #define HQLERR_JoinXTooComplex_Text             "JOIN%s contains no equality conditions - use ,ALL to allow"
 #define HQLERR_GlobalDedupFuzzy_Text            "A global DEDUP(ALL) or local hash dedup cannot include comparisons in the dedup criteria"
 #define HQLERR_GlobalDedupNoEquality_Text       "Global dedup,ALL must have a field to partition"

+ 1 - 1
ecl/hqlcpp/hqlhtcpp.cpp

@@ -17492,7 +17492,7 @@ void HqlCppTranslator::traceExpressions(const char * title, WorkflowArray & work
         {
             StringBuffer s;
             processedTreeToECL(compound, s);
-            LOG(debug500, unknownJob, "%s: #%d: id[%d,%d]", title, idx1, cur.queryWfid());
+            LOG(debug500, unknownJob, "%s: #%d: id[%d]", title, idx1, cur.queryWfid());
             logECL(debug500, s.length(), s.str());
         }
     }

+ 1 - 1
ecl/hqlcpp/hqlstep.cpp

@@ -156,7 +156,7 @@ bool SteppingCondition::extractSteppingCondition(IHqlExpression * expr, IHqlExpr
     }
 
     if (stepArgs.ordinality())
-        throwError(HQLERR_SteppingNotMatchSortCondition);
+        throwError1(HQLERR_SteppingNotMatchSortCondition, "");
 
     //Walk the list of non stepped condition, and retain any that are dependent on rows(left)
     ForEachItemIn(i3, args)

+ 2 - 2
ecl/hqlcpp/hqlttcpp.cpp

@@ -9957,12 +9957,12 @@ public:
     virtual void reportError(int errNo, const char *msg, const char *filename, int lineno, int column, int pos)
     {
         errors->reportError(errNo, msg, filename, lineno, column, pos);
-        throw MakeStringException(HQLERR_ErrorAlreadyReported, "");
+        throw MakeStringException(HQLERR_ErrorAlreadyReported, "%s", "");
     }
     virtual void report(IECLError* error)
     {
         errors->report(error);
-        throw MakeStringException(HQLERR_ErrorAlreadyReported, "");
+        throw MakeStringException(HQLERR_ErrorAlreadyReported, "%s", "");
     }
     virtual void reportWarning(int warnNo, const char *msg, const char *filename, int lineno, int column, int pos)
     {

+ 1 - 1
ecl/hthor/hthor.cpp

@@ -71,7 +71,7 @@ IRowManager * queryRowManager()
 
 void throwOOMException(size_t size, char const * label)
 {
-    throw MakeStringException(0, "Out of Memory in hthor: trying to allocate %u bytes for %s", size, label);
+    throw MakeStringException(0, "Out of Memory in hthor: trying to allocate %"I64F"u bytes for %s", (unsigned __int64) size, label);
 }
 
 void * checked_malloc(size_t size, char const * label)

+ 1 - 1
esp/services/WsDeploy/WsDeployService.cpp

@@ -5135,7 +5135,7 @@ void CWsDeployFileInfo::getNavigationData(IEspContext &context, IPropertyTree* p
         context.getUserID(sbName);
         context.getPeer(sbUserIp);
         if (strcmp(sbName.str(), m_userWithLock.str()) || strcmp(sbUserIp.str(), m_userIp.str()))
-          throw MakeStringException(-1, "%A user on machine %s is accessing the file. Please try after sometime.", m_userIp.str());
+          throw MakeStringException(-1, "A user on machine %s is accessing the file. Please try again later.", m_userIp.str());
       }
 
       initFileInfo(false);

+ 1 - 1
esp/services/ws_ecl/ws_ecl_json.cpp

@@ -112,7 +112,7 @@ void createPTreeFromJsonString(const char *json, bool caseInsensitive, StringBuf
     const char *finger = json;
     for (; *finger ; finger++) {
         if (!JSON_parser_char(jc, *finger)) {
-            throw MakeStringException(-1, "JSON_parser_char: syntax error, byte %d\n", finger - json);
+            throw MakeStringException(-1, "JSON_parser_char: syntax error, byte %d\n", (int) (finger - json));
         }
     }
     if (!JSON_parser_done(jc)) {

+ 1 - 1
esp/services/ws_ecl/ws_ecl_service.cpp

@@ -1561,7 +1561,7 @@ void CWsEclBinding::getWsEclJsonResponse(StringBuffer& jsonmsg, IEspContext &con
         }
     }
 
-    jsonmsg.appendf("    }\n  }\n}", wsinfo.queryname.sget());
+    jsonmsg.append("    }\n  }\n}");
 
 }
 

+ 1 - 1
esp/services/ws_fs/ws_fsService.cpp

@@ -1484,7 +1484,7 @@ bool CFileSprayEx::onDFUWorkunitsAction(IEspContext &context, IEspDFUWorkunitsAc
                 {
                     StringBuffer reply;
                     cmd->getId(0,reply);
-                    msg.appendf("Restore: %s, reply: $s", wuid, reply.str());
+                    msg.appendf("Restore: %s, reply: %s", wuid, reply.str());
                 }
 
                 Owned<IEspDFUActionResult> res = createDFUActionResult("", "");

+ 2 - 2
esp/services/ws_smc/ws_smcService.cpp

@@ -70,7 +70,7 @@ struct QueueWrapper
         if (!cluster || !*cluster)
             return;
 
-        char* type = eqThorCluster;
+        const char* type = eqThorCluster;
         if (clusterType < 1)
             type = eqRoxieCluster;
 
@@ -129,7 +129,7 @@ void CWsSMCEx::init(IPropertyTree *cfg, const char *process, const char *service
     m_BannerScroll = "2";
 
     StringBuffer xpath;
-    xpath.appendf("Software/EspProcess[@name='%s']/@portalurl", process, service);
+    xpath.appendf("Software/EspProcess[@name='%s']/@portalurl", process);
     const char* portalURL = cfg->queryProp(xpath.str());
     if (portalURL && *portalURL)
         m_PortalURL.append(portalURL);

+ 5 - 5
esp/services/ws_workunits/ws_workunitsService.cpp

@@ -4361,7 +4361,7 @@ bool CWsWorkunitsEx::onWUDeployWorkunit(IEspContext &context, IEspWUDeployWorkun
     IConstWorkUnit* wu= factory->openWorkUnit(wuid.str(), false);
     if (!wu)
     {
-        throw MakeStringException(ECLWATCH_CANNOT_OPEN_WORKUNIT,"Cannot find the workunit for file %s.");
+        throw MakeStringException(ECLWATCH_CANNOT_OPEN_WORKUNIT,"Cannot find the workunit %s", wuid.str());
     }
 
     SCMStringBuffer queryName;
@@ -7008,14 +7008,14 @@ void CWsWorkunitsEx::getWorkunitCluster(IEspContext &context, const char* wuid,
 void CWsWorkunitsEx::getWorkunitXml(IEspContext &context, const char* wuid, const char* plainText, MemoryBuffer& buf)
 {
     SCMStringBuffer x;
-   CWUWrapper wu(wuid, context);
-   exportWorkUnitToXML(wu, x);
+    CWUWrapper wu(wuid, context);
+    exportWorkUnitToXML(wu, x);
    
-    char* header="<?xml version=\"1.0\" encoding=\"UTF-8\"?><?xml-stylesheet href=\"../esp/xslt/xmlformatter.xsl\" type=\"text/xsl\"?>";
+    const char* header="<?xml version=\"1.0\" encoding=\"UTF-8\"?><?xml-stylesheet href=\"../esp/xslt/xmlformatter.xsl\" type=\"text/xsl\"?>";
     if (plainText && (!stricmp(plainText, "yes")))
         header="<?xml version=\"1.0\" encoding=\"UTF-8\"?>";
 
-   buf.append(strlen(header),header);
+    buf.append(strlen(header),header);
     buf.append(x.length(),x.str());
 }
 

+ 4 - 4
plugins/fileservices/fileservices.cpp

@@ -1957,7 +1957,7 @@ static void checkExternalFileRights(ICodeContext *ctx, CDfsLogicalFileName &lfn,
     }
     else if (rd) {
         if (!HASREADPERMISSION(perm)) {
-            throw MakeStringException(-1,"Read permission denied for",extpath.get());
+            throw MakeStringException(-1,"Read permission denied for %s",extpath.get());
         }
     }
 }
@@ -1967,7 +1967,7 @@ FILESERVICES_API void  FILESERVICES_CALL fsMoveExternalFile(ICodeContext * ctx,c
 {
     SocketEndpoint ep(location);
     if (ep.isNull())
-        throw MakeStringException(-1,"fsMoveExternalFile: Cannot resolve location",location);
+        throw MakeStringException(-1,"fsMoveExternalFile: Cannot resolve location %s",location);
     CDfsLogicalFileName from;
     from.setExternal(location,frompath);
     CDfsLogicalFileName to;
@@ -1994,7 +1994,7 @@ FILESERVICES_API void  FILESERVICES_CALL fsDeleteExternalFile(ICodeContext * ctx
 {
     SocketEndpoint ep(location);
     if (ep.isNull())
-        throw MakeStringException(-1,"fsDeleteExternalFile: Cannot resolve location",location);
+        throw MakeStringException(-1,"fsDeleteExternalFile: Cannot resolve location %s",location);
     CDfsLogicalFileName lfn;
     lfn.setExternal(location,path);
     checkExternalFileRights(ctx,lfn,false,true);
@@ -2012,7 +2012,7 @@ FILESERVICES_API void  FILESERVICES_CALL fsCreateExternalDirectory(ICodeContext
 {
     SocketEndpoint ep(location);
     if (ep.isNull())
-        throw MakeStringException(-1,"fsCreateExternalDirectory: Cannot resolve location",location);
+        throw MakeStringException(-1,"fsCreateExternalDirectory: Cannot resolve location %s",location);
     CDfsLogicalFileName lfn;
     lfn.setExternal(location,path);
     checkExternalFileRights(ctx,lfn,false,true);

+ 5 - 5
roxie/ccd/ccdfile.cpp

@@ -955,7 +955,7 @@ public:
     {
         bctStarted.signal();
         if (traceLevel)
-            DBGLOG("Background copy thread %x starting", this);
+            DBGLOG("Background copy thread %p starting", this);
         try
         {
             int fileCopiedCount = 0;
@@ -1024,7 +1024,7 @@ public:
             DBGLOG("Unknown exception in background copy thread");
         }
         if (traceLevel)
-            DBGLOG("Background copy thread %x exiting", this);
+            DBGLOG("Background copy thread %p exiting", this);
         return 0;
     }
 
@@ -1032,7 +1032,7 @@ public:
     {
         hctStarted.signal();
         if (traceLevel)
-            DBGLOG("HandleCloser thread %x starting", this);
+            DBGLOG("HandleCloser thread %p starting", this);
         try
         {
             loop
@@ -1055,7 +1055,7 @@ public:
             DBGLOG("Unknown exception in handle closer thread");
         }
         if (traceLevel)
-            DBGLOG("Handle closer thread %x exiting", this);
+            DBGLOG("Handle closer thread %p exiting", this);
         return 0;
     }
 
@@ -1625,7 +1625,7 @@ public:
     {
         if (part > numParts || part == 0)
         {
-            throw MakeStringException(ROXIE_FILE_FAIL, "Internal error - requesting base for non-existant file part %s (valid are 1-%d)", part, numParts);
+            throw MakeStringException(ROXIE_FILE_FAIL, "Internal error - requesting base for non-existant file part %d (valid are 1-%d)", part, numParts);
         }
         return map[part-1].base;
     }

+ 1 - 1
roxie/ccd/ccdkey.cpp

@@ -1167,7 +1167,7 @@ public:
                         offset_t size = file->size();
                         baseMap.addFragment(fileEnd, size, idx-1, base, 0);
                         if (traceLevel > 6)
-                            DBGLOG("File fragment %d size %d", idx, size);
+                            DBGLOG("File fragment %d size %"I64F"d", idx, size);
                         totalSize += size; // MORE - check for overflow here
                     }
                 }

+ 1 - 1
roxie/ccd/ccdquery.cpp

@@ -1114,7 +1114,7 @@ public:
     {
         // addDependency is expected to fail occasionally on slave, but never on Roxie server
         if (!doAddDependency(sourceIdx, sourceId, targetId, controlId, edgeId, activities))
-            throw MakeStringException(ROXIE_ADDDEPENDENCY_ERROR, "Failed to create dependency from %s on %s", sourceId, targetId);
+            throw MakeStringException(ROXIE_ADDDEPENDENCY_ERROR, "Failed to create dependency from %u on %u", sourceId, targetId);
     }
 
     virtual ActivityArray *loadGraph(IPropertyTree &graph, const char *graphName)

+ 5 - 5
roxie/roxiemem/roxiemem.cpp

@@ -93,8 +93,8 @@ void initializeHeap(unsigned pages)
 #else
     int ret;
     if ((ret = posix_memalign((void **) &heapBase, HEAP_ALIGNMENT_SIZE, memsize)) != 0) {
-        DBGLOG("RoxieMemMgr: posix_memalign (alignment=%u, size=%u) failed - ret=%d", 
-                HEAP_ALIGNMENT_SIZE, memsize, ret);
+        DBGLOG("RoxieMemMgr: posix_memalign (alignment=%"I64F"u, size=%"I64F"u) failed - ret=%d", 
+                (unsigned __int64) HEAP_ALIGNMENT_SIZE, (unsigned __int64) memsize, ret);
         HEAPERROR("RoxieMemMgr: Unable to create heap");
     }
 #endif
@@ -103,8 +103,8 @@ void initializeHeap(unsigned pages)
     heapLWM = 0;
 
     if (memTraceLevel)
-        DBGLOG("RoxieMemMgr: %u Pages successfully allocated for the pool - memsize=%u base=%p alignment=%u bitmapSize=%u", 
-                heapBitmapSize * UNSIGNED_BITS, memsize, heapBase, HEAP_ALIGNMENT_SIZE, heapBitmapSize);
+        DBGLOG("RoxieMemMgr: %u Pages successfully allocated for the pool - memsize=%"I64F"u base=%p alignment=%"I64F"u bitmapSize=%u", 
+                heapBitmapSize * UNSIGNED_BITS, (unsigned __int64) memsize, heapBase, (unsigned __int64) HEAP_ALIGNMENT_SIZE, heapBitmapSize);
 }
 
 extern void releaseRoxieHeap()
@@ -1300,7 +1300,7 @@ public:
         pageLimit = (unsigned) (bytes / HEAP_ALIGNMENT_SIZE);
 
         if (memTraceLevel >= 2)
-            logctx.CTXLOG("RoxieMemMgr: CChunkingRowManager::setMemoryLimit new memlimit=%u pageLimit=%u rowMgr=%p", bytes, pageLimit, this);
+            logctx.CTXLOG("RoxieMemMgr: CChunkingRowManager::setMemoryLimit new memlimit=%"I64F"u pageLimit=%u rowMgr=%p", (unsigned __int64) bytes, pageLimit, this);
     }
 
     virtual void *resizeRow(void * original, unsigned oldsize, unsigned newsize, unsigned activityId)

+ 2 - 2
roxie/udplib/udpsha.cpp

@@ -318,9 +318,9 @@ void setLinuxThreadPriority(int level)
         param.sched_priority = level;
     }
     if(( rc = pthread_setschedparam(self, policy, &param)) != 0) 
-        DBGLOG("pthread_setschedparam error: %d policy=%i pr=%i id=%i PID=%i", rc, policy, param.sched_priority, self,getpid());
+        DBGLOG("pthread_setschedparam error: %d policy=%i pr=%i id=%"I64F"i PID=%i", rc, policy, param.sched_priority, (unsigned __int64) self, getpid());
     else
-        DBGLOG("priority set id=%i policy=%i pri=%i PID=%i", self, policy, param.sched_priority, getpid());
+        DBGLOG("priority set id=%"I64F"i policy=%i pri=%i PID=%i", (unsigned __int64) self, policy, param.sched_priority, getpid());
 }
 #endif
 

+ 1 - 1
roxie/udplib/uttest.cpp

@@ -357,7 +357,7 @@ void testNxN()
         DBGLOG("Node %d All Sent %"I64F"d bytes total, rate = %.2f MB/s", myIndex, sentTotal, (((double)sentTotal)/1048576.0)/((msTick()-start)/1000.0));
         while (!sendMgr->allDone())
         {
-            DBGLOG("Node %d waiting for queued data to be flushed", myIndex, sentTotal, (((double)sentTotal)/1048576.0)/((msTick()-start)/1000.0));
+            DBGLOG("Node %d waiting for queued data to be flushed", myIndex);
             Sleep(1000);
         }
         DBGLOG("All data sent");

+ 1 - 1
system/jhtree/ctfile.cpp

@@ -793,7 +793,7 @@ extern jhtree_decl void validateKeyFile(const char *filename, offset_t nodePos)
     if (hdr.phyrec != size-1)
         throw MakeStringException(5, "Invalid key %s: phyrec was %"I64F"d, expected %"I64F"d", filename, hdr.phyrec, size-1);
     if (size % hdr.nodeSize)
-        throw MakeStringException(3, "Invalid key %s: size %d is not a multiple of key node size (%d)", filename, size, hdr.nodeSize);
+        throw MakeStringException(3, "Invalid key %s: size %"I64F"d is not a multiple of key node size (%d)", filename, size, hdr.nodeSize);
     if (!hdr.root || hdr.root % hdr.nodeSize !=0)
         throw MakeStringException(6, "Invalid key %s: invalid root pointer %"I64F"x", filename, hdr.root);
     NodeHdr root;

+ 2 - 2
system/jhtree/jhtree.cpp

@@ -1372,7 +1372,7 @@ CMemKeyIndex::CMemKeyIndex(int _iD, IMemoryMappedFile *_io, const char *_name, b
     assertex(io->length()==io->fileSize());     // mapped whole file
     KeyHdr hdr;
     if (io->length() < sizeof(hdr))
-        throw MakeStringException(0, "Failed to read key header: file too small, could not read %u bytes", sizeof(hdr));
+        throw MakeStringException(0, "Failed to read key header: file too small, could not read %u bytes", (unsigned) sizeof(hdr));
     memcpy(&hdr, io->base(), sizeof(hdr));
     init(hdr, isTLK, false);
 }
@@ -1399,7 +1399,7 @@ CDiskKeyIndex::CDiskKeyIndex(int _iD, IFileIO *_io, const char *_name, bool isTL
     io.setown(_io);
     KeyHdr hdr;
     if (io->read(0, sizeof(hdr), &hdr) != sizeof(hdr))
-        throw MakeStringException(0, "Failed to read key header: file too small, could not read %u bytes", sizeof(hdr));
+        throw MakeStringException(0, "Failed to read key header: file too small, could not read %u bytes", (unsigned) sizeof(hdr));
     init(hdr, isTLK, allowPreload);
 }
 

+ 1 - 1
system/jlib/jbuff.cpp

@@ -103,7 +103,7 @@ public:
 // Bit risky if *very* out of memory so protect against recursion and catch exceptions
             try { 
                 // try to log
-                PROGLOG("Jbuff: Out of Memory (%d,%d,%dk)",_errcode,_wanted,_got/1024);
+                PROGLOG("Jbuff: Out of Memory (%d,%d,%"I64F"dk)",_errcode,_wanted,(unsigned __int64) (got/1024));
                 PrintStackReport();
                 PrintMemoryReport();
             }

+ 1 - 1
system/jlib/jdebug.cpp

@@ -1670,7 +1670,7 @@ public:
             out.append(' ');
         }
         if (totalcpu)
-          out.appendf("CPU: usr=%d sys=%d iow=%d", (unsigned)(cpu.user*100/totalcpu), (unsigned)(cpu.system*100/totalcpu), (unsigned)(cpu.iowait*100/totalcpu), (unsigned)(cpu.idle*100/totalcpu));
+          out.appendf("CPU: usr=%d sys=%d iow=%d idle=%d", (unsigned)(cpu.user*100/totalcpu), (unsigned)(cpu.system*100/totalcpu), (unsigned)(cpu.iowait*100/totalcpu), (unsigned)(cpu.idle*100/totalcpu));
         return true;
     }
 

+ 6 - 6
system/jlib/jexcept.cpp

@@ -961,15 +961,15 @@ void excsighandler(int signum, siginfo_t *info, void *extra)
     PROGLOG("================================================");
     PROGLOG("Signal:    %d %s",signum,strsignal(signum));
     PROGLOG("Fault IP:  "I64X"", ip);
-    PROGLOG("Accessing: "I64X"", info->si_addr);
+    PROGLOG("Accessing: "I64X"", (unsigned __int64) info->si_addr);
     PROGLOG("Registers:" );
     PROGLOG("EAX:"I64X"  EBX:"I64X"  ECX:"I64X"  EDX:"I64X"  ESI:"I64X"  EDI:"I64X"",
-        uc->uc_mcontext.gregs[REG_RAX], uc->uc_mcontext.gregs[REG_RBX], 
-        uc->uc_mcontext.gregs[REG_RCX], uc->uc_mcontext.gregs[REG_RDX], 
-        uc->uc_mcontext.gregs[REG_RSI], uc->uc_mcontext.gregs[REG_RDI] );
+        (unsigned __int64) uc->uc_mcontext.gregs[REG_RAX], (unsigned __int64)uc->uc_mcontext.gregs[REG_RBX], 
+        (unsigned __int64) uc->uc_mcontext.gregs[REG_RCX], (unsigned __int64) uc->uc_mcontext.gregs[REG_RDX], 
+        (unsigned __int64) uc->uc_mcontext.gregs[REG_RSI], (unsigned __int64) uc->uc_mcontext.gregs[REG_RDI] );
     
-    PROGLOG( "CS:EIP:%04X:"I64X"", ((unsigned)uc->uc_mcontext.gregs[REG_CSGSFS])&0xffff, ip );
-    PROGLOG( "   ESP:"I64X"  EBP:"I64X"",sp, uc->uc_mcontext.gregs[REG_RBP] );  
+    PROGLOG( "CS:EIP:%04X:"I64X"", ((unsigned) uc->uc_mcontext.gregs[REG_CSGSFS])&0xffff, ip );
+    PROGLOG( "   ESP:"I64X"  EBP:"I64X"", sp, (unsigned __int64) uc->uc_mcontext.gregs[REG_RBP] );  
     
     for (unsigned i=0;i<8;i++) {
         StringBuffer s;

+ 8 - 8
system/jlib/jexcept.hpp

@@ -92,27 +92,27 @@ interface IExceptionHandler
    virtual bool fireException(IException *e) = 0;
 };
 
-IException jlib_decl *MakeStringException(int code,const char *why, ...);
+IException jlib_decl *MakeStringException(int code,const char *why, ...) __attribute__((format(printf, 2, 3)));
 IException jlib_decl *MakeStringExceptionVA(int code,const char *why, va_list args);
 IException jlib_decl *MakeStringExceptionDirect(int code,const char *why);
-IException jlib_decl *MakeStringException(MessageAudience aud,int code,const char *why, ...);
+IException jlib_decl *MakeStringException(MessageAudience aud,int code,const char *why, ...) __attribute__((format(printf, 3, 4)));
 IException jlib_decl *MakeStringExceptionVA(MessageAudience aud,int code,const char *why, va_list args);
 IException jlib_decl *MakeStringExceptionDirect(MessageAudience aud,int code,const char *why);
-void jlib_decl ThrowStringException(int code,const char *format, ...);
+void jlib_decl ThrowStringException(int code,const char *format, ...) __attribute__((format(printf, 2, 3)));
 
 interface jlib_thrown_decl IOSException: extends IException{};
 IOSException jlib_decl *MakeOsException(int code);
-IOSException jlib_decl *MakeOsException(int code, const char *msg, ...);
+IOSException jlib_decl *MakeOsException(int code, const char *msg, ...) __attribute__((format(printf, 2, 3)));
 
 #define DISK_FULL_EXCEPTION_CODE ENOSPC
 
 interface jlib_thrown_decl IErrnoException: extends IException{};
 IErrnoException jlib_decl *MakeErrnoException(int errn=-1);
-IErrnoException jlib_decl *MakeErrnoException(int errn, const char *why, ...);
-IErrnoException jlib_decl *MakeErrnoException(const char *why, ...);
+IErrnoException jlib_decl *MakeErrnoException(int errn, const char *why, ...) __attribute__((format(printf, 2, 3)));
+IErrnoException jlib_decl *MakeErrnoException(const char *why, ...) __attribute__((format(printf, 1, 2)));
 IErrnoException jlib_decl *MakeErrnoException(MessageAudience aud,int errn=-1);
-IErrnoException jlib_decl *MakeErrnoException(MessageAudience aud,int errn, const char *why, ...);
-IErrnoException jlib_decl *MakeErrnoException(MessageAudience aud,const char *why, ...);
+IErrnoException jlib_decl *MakeErrnoException(MessageAudience aud,int errn, const char *why, ...) __attribute__((format(printf, 3, 4)));
+IErrnoException jlib_decl *MakeErrnoException(MessageAudience aud,const char *why, ...) __attribute__((format(printf, 2, 3)));
 
 void jlib_decl pexception(const char *msg,IException *e); // like perror except for exceptions
 jlib_decl StringBuffer & formatSystemError(StringBuffer & out, unsigned errcode);

+ 3 - 3
system/jlib/jfile.cpp

@@ -1529,7 +1529,7 @@ IFileIO *_createIFileIO(const void *buffer, unsigned sz, bool readOnly)
         virtual size32_t read(offset_t pos, size32_t len, void * data)
         {
             if (pos>sz)
-                throw MakeStringException(-1, "CMemoryBufferIO: read beyond end of buffer pos=%d, len=%d, buffer length=%d", pos, len, mb.length());
+                throw MakeStringException(-1, "CMemoryBufferIO: read beyond end of buffer pos=%"I64F"d, len=%d, buffer length=%d", pos, len, mb.length());
             if (pos+len > sz)
                 len = (size32_t)(sz-pos);
             memcpy(data, (byte *)buffer+pos, len);
@@ -1541,7 +1541,7 @@ IFileIO *_createIFileIO(const void *buffer, unsigned sz, bool readOnly)
         {
             assertex(!readOnly);
             if (pos+len>sz)
-                throw MakeStringException(-1, "CMemoryBufferIO: UNIMPLEMENTED, writing beyond buffer, pos=%d, len=%d, buffer length=%d", pos, len, mb.length());
+                throw MakeStringException(-1, "CMemoryBufferIO: UNIMPLEMENTED, writing beyond buffer, pos=%"I64F"d, len=%d, buffer length=%d", pos, len, mb.length());
             memcpy((byte *)buffer+pos, data, len);
             return len;
         }
@@ -1549,7 +1549,7 @@ IFileIO *_createIFileIO(const void *buffer, unsigned sz, bool readOnly)
         virtual void setSize(offset_t size)
         {
             if (size > mb.length())
-                throw MakeStringException(-1, "CMemoryBufferIO: UNIMPLEMENTED, setting size beyond end of buffer, pos="I64F"d, buffer length=%d", size, mb.length());
+                throw MakeStringException(-1, "CMemoryBufferIO: UNIMPLEMENTED, setting size %"I64F"d beyond end of buffer, buffer length=%d", size, mb.length());
             mb.setLength((size32_t)size);
         }
 

+ 1 - 1
system/jlib/jflz.cpp

@@ -696,7 +696,7 @@ public:
         else
             inbuf = (byte *)inma.bufferBase();
         if (blksz<1024)
-            throw MakeStringException(-1,"CFastLZCompressor::open - block size (%d) not large enough");
+            throw MakeStringException(-1,"CFastLZCompressor::open - block size (%d) not large enough", blksz);
         *(size32_t *)outbuf = 0;
         outlen = sizeof(size32_t);
         inlen = 0;

+ 36 - 19
system/jlib/jlog.hpp

@@ -539,24 +539,24 @@ interface jlib_decl ILogMsgManager : public ILogMsgListener
     virtual void              resetQueueLimit() = 0;
     virtual bool              flushQueue(unsigned timeout) = 0;
     virtual void              resetMonitors() = 0;
-    virtual void              report(const LogMsgCategory & cat, const char * format, ...) = 0;
+    virtual void              report(const LogMsgCategory & cat, const char * format, ...) __attribute__((format(printf, 3, 4))) = 0;
     virtual void              report_va(const LogMsgCategory & cat, const char * format, va_list args) = 0;
-    virtual void              report(const LogMsgCategory & cat, LogMsgCode code , const char * format, ...) = 0;
+    virtual void              report(const LogMsgCategory & cat, LogMsgCode code , const char * format, ...) __attribute__((format(printf, 4, 5))) = 0;
     virtual void              report_va(const LogMsgCategory & cat, LogMsgCode code , const char * format, va_list args) = 0;
     virtual void              report(const LogMsgCategory & cat, const IException * e, const char * prefix = NULL) = 0;
-    virtual void              report(unsigned compo, const LogMsgCategory & cat, const char * format, ...) = 0;
+    virtual void              report(unsigned compo, const LogMsgCategory & cat, const char * format, ...) __attribute__((format(printf, 4, 5))) = 0;
     virtual void              report_va(unsigned compo, const LogMsgCategory & cat, const char * format, va_list args) = 0;
-    virtual void              report(unsigned compo, const LogMsgCategory & cat, LogMsgCode code , const char * format, ...) = 0;
+    virtual void              report(unsigned compo, const LogMsgCategory & cat, LogMsgCode code , const char * format, ...) __attribute__((format(printf, 5, 6))) = 0;
     virtual void              report_va(unsigned compo, const LogMsgCategory & cat, LogMsgCode code , const char * format, va_list args) = 0;
     virtual void              report(unsigned compo, const LogMsgCategory & cat, const IException * e, const char * prefix = NULL) = 0;
-    virtual void              report(const LogMsgCategory & cat, const LogMsgJobInfo & job, const char * format, ...) = 0;
+    virtual void              report(const LogMsgCategory & cat, const LogMsgJobInfo & job, const char * format, ...) __attribute__((format(printf, 4, 5))) = 0;
     virtual void              report_va(const LogMsgCategory & cat, const LogMsgJobInfo & job, const char * format, va_list args) = 0;
-    virtual void              report(const LogMsgCategory & cat, const LogMsgJobInfo & job, LogMsgCode code , const char * format, ...) = 0;
+    virtual void              report(const LogMsgCategory & cat, const LogMsgJobInfo & job, LogMsgCode code , const char * format, ...) __attribute__((format(printf, 5, 6))) = 0;
     virtual void              report_va(const LogMsgCategory & cat, const LogMsgJobInfo & job, LogMsgCode code , const char * format, va_list args) = 0;
     virtual void              report(const LogMsgCategory & cat, const LogMsgJobInfo & job, const IException * e, const char * prefix = NULL) = 0;
-    virtual void              report(unsigned compo, const LogMsgCategory & cat, const LogMsgJobInfo & job, const char * format, ...) = 0;
+    virtual void              report(unsigned compo, const LogMsgCategory & cat, const LogMsgJobInfo & job, const char * format, ...) __attribute__((format(printf, 5, 6))) = 0;
     virtual void              report_va(unsigned compo, const LogMsgCategory & cat, const LogMsgJobInfo & job, const char * format, va_list args) = 0;
-    virtual void              report(unsigned compo, const LogMsgCategory & cat, const LogMsgJobInfo & job, LogMsgCode code , const char * format, ...) = 0;
+    virtual void              report(unsigned compo, const LogMsgCategory & cat, const LogMsgJobInfo & job, LogMsgCode code , const char * format, ...) __attribute__((format(printf, 6, 7))) = 0;
     virtual void              report_va(unsigned compo, const LogMsgCategory & cat, const LogMsgJobInfo & job, LogMsgCode code , const char * format, va_list args) = 0;
     virtual void              report(unsigned compo, const LogMsgCategory & cat, const LogMsgJobInfo & job, const IException * e, const char * prefix = NULL) = 0;
     virtual void              report(const LogMsg & msg) const = 0;
@@ -572,14 +572,14 @@ class jlib_decl LogMsgComponentReporter
 {
 public:
     LogMsgComponentReporter(unsigned _compo) : component(_compo) {}
-    void                  report(const LogMsgCategory & cat, const char * format, ...);
+    void                  report(const LogMsgCategory & cat, const char * format, ...) __attribute__((format(printf, 3, 4)));
     void                  report_va(const LogMsgCategory & cat, const char * format, va_list args);
-    void                  report(const LogMsgCategory & cat, LogMsgCode code, const char * format, ...);
+    void                  report(const LogMsgCategory & cat, LogMsgCode code, const char * format, ...) __attribute__((format(printf, 4, 5)));
     void                  report_va(const LogMsgCategory & cat, LogMsgCode code, const char * format, va_list args);
     void                  report(const LogMsgCategory & cat, const IException * e, const char * prefix = NULL);
-    void                  report(const LogMsgCategory & cat, const LogMsgJobInfo & job, const char * format, ...);
+    void                  report(const LogMsgCategory & cat, const LogMsgJobInfo & job, const char * format, ...) __attribute__((format(printf, 4, 5)));
     void                  report_va(const LogMsgCategory & cat, const LogMsgJobInfo & job, const char * format, va_list args);
-    void                  report(const LogMsgCategory & cat, const LogMsgJobInfo & job, LogMsgCode code, const char * format, ...);
+    void                  report(const LogMsgCategory & cat, const LogMsgJobInfo & job, LogMsgCode code, const char * format, ...) __attribute__((format(printf, 5, 6)));
     void                  report_va(const LogMsgCategory & cat, const LogMsgJobInfo & job, LogMsgCode code, const char * format, va_list args);
     void                  report(const LogMsgCategory & cat, const LogMsgJobInfo & job, const IException * e, const char * prefix = NULL);
     void                  report(const LogMsg & msg);
@@ -595,14 +595,14 @@ public:
     // N.B. This method locks the critical section...
     LogMsgPrepender * setContext(LogMsgComponentReporter * r, char const * f, unsigned l);
     // ... and these ones unlock it. So they should be used in pairs.
-    void                      report(const LogMsgCategory & cat, const char * format, ...);
+    void                      report(const LogMsgCategory & cat, const char * format, ...) __attribute__((format(printf, 3, 4)));
     void                      report_va(const LogMsgCategory & cat, const char * format, va_list args);
-    void                      report(const LogMsgCategory & cat, LogMsgCode code, const char * format, ...);
+    void                      report(const LogMsgCategory & cat, LogMsgCode code, const char * format, ...) __attribute__((format(printf, 4, 5)));
     void                      report_va(const LogMsgCategory & cat, LogMsgCode code, const char * format, va_list args);
     void                      report(const LogMsgCategory & cat, const IException * e, const char * prefix = NULL);
-    void                      report(const LogMsgCategory & cat, const LogMsgJobInfo & job, const char * format, ...);
+    void                      report(const LogMsgCategory & cat, const LogMsgJobInfo & job, const char * format, ...) __attribute__((format(printf, 4, 5)));
     void                      report_va(const LogMsgCategory & cat, const LogMsgJobInfo & job, const char * format, va_list args);
-    void                      report(const LogMsgCategory & cat, const LogMsgJobInfo & job, LogMsgCode code, const char * format, ...);
+    void                      report(const LogMsgCategory & cat, const LogMsgJobInfo & job, LogMsgCode code, const char * format, ...) __attribute__((format(printf, 5, 6)));
     void                      report_va(const LogMsgCategory & cat, const LogMsgJobInfo & job, LogMsgCode code, const char * format, va_list args);
     void                      report(const LogMsgCategory & cat, const LogMsgJobInfo & job, const IException * e, const char * prefix = NULL);
     IException *              report(IException * e, const char * prefix = NULL, LogMsgClass cls = MSGCLS_error); // uses MCexception(e, cls), unknownJob, handy for EXCLOG
@@ -722,6 +722,7 @@ inline void LOG(const LogMsg & msg)
 {
     LOGMSGREPORTER->report(msg);
 }
+void LOG(const LogMsgCategory & cat, const char * format, ...) __attribute__((format(printf, 2, 3)));
 inline void LOG(const LogMsgCategory & cat, const char * format, ...)
 {
     va_list args;
@@ -729,6 +730,7 @@ inline void LOG(const LogMsgCategory & cat, const char * format, ...)
     LOGMSGREPORTER->report_va(cat, format, args);
     va_end(args);
 }
+void LOG(const LogMsgCategory & cat, LogMsgCode code , const char * format, ...) __attribute__((format(printf, 3, 4)));
 inline void LOG(const LogMsgCategory & cat, LogMsgCode code , const char * format, ...)
 {
     va_list args;
@@ -736,6 +738,7 @@ inline void LOG(const LogMsgCategory & cat, LogMsgCode code , const char * forma
     LOGMSGREPORTER->report_va(cat, code , format, args);
     va_end(args);
 }
+inline void LOG(const LogMsgCategory & cat, const LogMsgJobInfo & job, const char * format, ...) __attribute__((format(printf, 3, 4)));
 inline void LOG(const LogMsgCategory & cat, const LogMsgJobInfo & job, const char * format, ...)
 {
     va_list args;
@@ -743,6 +746,7 @@ inline void LOG(const LogMsgCategory & cat, const LogMsgJobInfo & job, const cha
     LOGMSGREPORTER->report_va(cat, job, format, args);
     va_end(args);
 }
+inline void LOG(const LogMsgCategory & cat, const LogMsgJobInfo & job, LogMsgCode code , const char * format, ...) __attribute__((format(printf, 4, 5)));
 inline void LOG(const LogMsgCategory & cat, const LogMsgJobInfo & job, LogMsgCode code , const char * format, ...)
 {
     va_list args;
@@ -788,6 +792,7 @@ inline void VALOG(const LogMsgCategory & cat, const LogMsgJobInfo & job, LogMsgC
 #define TOSTRLOG(category, job, prefix, func) { if (!REJECTLOG(category)) { StringBuffer buff; func(buff); LOGMSGREPORTER->report(category, job, prefix"'%s'", buff.str()); } }
 #define EVENTLOG(code, extra) LOGMSGREPORTER->report(MCevent, unknownJob, code, extra)
 
+inline void DBGLOG(char const * format, ...) __attribute__((format(printf, 1, 2)));
 inline void DBGLOG(char const * format, ...)
 {
     va_list args;
@@ -796,6 +801,7 @@ inline void DBGLOG(char const * format, ...)
     va_end(args);
 }
 
+inline void DISLOG(char const * format, ...) __attribute__((format(printf, 1, 2)));
 inline void DISLOG(char const * format, ...)
 {
     va_list args;
@@ -804,7 +810,8 @@ inline void DISLOG(char const * format, ...)
     va_end(args);
 }
 
-inline void ERRLOG(char const * format, ...)
+inline void ERRLOG(char const * format, ...) __attribute__((format(printf, 1, 2)));
+inline void ERRLOG(char const * format, ...) 
 {
     va_list args;
     va_start(args, format);
@@ -812,6 +819,7 @@ inline void ERRLOG(char const * format, ...)
     va_end(args);
 }
 
+inline void OERRLOG(char const * format, ...) __attribute__((format(printf, 1, 2)));
 inline void OERRLOG(char const * format, ...)
 {
     va_list args;
@@ -820,6 +828,7 @@ inline void OERRLOG(char const * format, ...)
     va_end(args);
 }
 
+inline void IERRLOG(char const * format, ...) __attribute__((format(printf, 1, 2)));
 inline void IERRLOG(char const * format, ...)
 {
     va_list args;
@@ -828,6 +837,7 @@ inline void IERRLOG(char const * format, ...)
     va_end(args);
 }
 
+inline void WARNLOG(char const * format, ...) __attribute__((format(printf, 1, 2)));
 inline void WARNLOG(char const * format, ...)
 {
     va_list args;
@@ -836,6 +846,7 @@ inline void WARNLOG(char const * format, ...)
     va_end(args);
 }
 
+inline void PROGLOG(char const * format, ...) __attribute__((format(printf, 1, 2)));
 inline void PROGLOG(char const * format, ...)
 {
     va_list args;
@@ -844,6 +855,7 @@ inline void PROGLOG(char const * format, ...)
     va_end(args);
 }
 
+inline void DBGLOG(LogMsgCode code, char const * format, ...) __attribute__((format(printf, 2, 3)));
 inline void DBGLOG(LogMsgCode code, char const * format, ...)
 {
     va_list args;
@@ -852,6 +864,7 @@ inline void DBGLOG(LogMsgCode code, char const * format, ...)
     va_end(args);
 }
 
+inline void DISLOG(LogMsgCode code, char const * format, ...) __attribute__((format(printf, 2, 3)));
 inline void DISLOG(LogMsgCode code, char const * format, ...)
 {
     va_list args;
@@ -860,6 +873,7 @@ inline void DISLOG(LogMsgCode code, char const * format, ...)
     va_end(args);
 }
 
+inline void ERRLOG(LogMsgCode code, char const * format, ...) __attribute__((format(printf, 2, 3)));
 inline void ERRLOG(LogMsgCode code, char const * format, ...)
 {
     va_list args;
@@ -868,6 +882,7 @@ inline void ERRLOG(LogMsgCode code, char const * format, ...)
     va_end(args);
 }
 
+inline void IERRLOG(LogMsgCode code, char const * format, ...) __attribute__((format(printf, 2, 3)));
 inline void IERRLOG(LogMsgCode code, char const * format, ...)
 {
     va_list args;
@@ -876,6 +891,7 @@ inline void IERRLOG(LogMsgCode code, char const * format, ...)
     va_end(args);
 }
 
+inline void WARNLOG(LogMsgCode code, char const * format, ...) __attribute__((format(printf, 2, 3)));
 inline void WARNLOG(LogMsgCode code, char const * format, ...)
 {
     va_list args;
@@ -884,6 +900,7 @@ inline void WARNLOG(LogMsgCode code, char const * format, ...)
     va_end(args);
 }
 
+inline void PROGLOG(LogMsgCode code, char const * format, ...) __attribute__((format(printf, 2, 3)));
 inline void PROGLOG(LogMsgCode code, char const * format, ...)
 {
     va_list args;
@@ -973,9 +990,9 @@ extern jlib_decl void UseSysLogForOperatorMessages(bool use=true);
 
 interface IContextLogger : extends IInterface
 {
-    virtual void CTXLOG(const char *format, ...) const = 0;
+    virtual void CTXLOG(const char *format, ...) const  __attribute__((format(printf, 2, 3))) = 0;
     virtual void CTXLOGva(const char *format, va_list args) const = 0;
-    virtual void logOperatorException(IException *E, const char *file, unsigned line, const char *format, ...) const = 0;
+    virtual void logOperatorException(IException *E, const char *file, unsigned line, const char *format, ...) const  __attribute__((format(printf, 5, 6))) = 0;
     virtual void logOperatorExceptionVA(IException *E, const char *file, unsigned line, const char *format, va_list args) const = 0;
     virtual void noteStatistic(unsigned statCode, unsigned __int64 value, unsigned count) const = 0; // Values for statcode defined in jstats.h
     virtual unsigned queryTraceLevel() const = 0;

+ 2 - 2
system/jlib/jthread.cpp

@@ -179,9 +179,9 @@ void Thread::adjustPriority(char delta)
         case +2: param.sched_priority =  sched_get_priority_max(SCHED_RR); policy =SCHED_RR;    break;
         }
         if(( rc = pthread_setschedparam(threadid, policy, &param)) != 0) 
-            DBGLOG("pthread_setschedparam error: %d policy=%i pr=%i id=%i PID=%i", rc,policy,param.sched_priority,threadid,getpid());
+            DBGLOG("pthread_setschedparam error: %d policy=%i pr=%i id=%"I64F"u PID=%i", rc,policy,param.sched_priority,(unsigned __int64) threadid,getpid());
         else
-            DBGLOG("priority set id=%i policy=%i pri=%i PID=%i",threadid,policy,param.sched_priority,getpid());
+            DBGLOG("priority set id=%"I64F"u policy=%i pri=%i PID=%i",(unsigned __int64) threadid,policy,param.sched_priority,getpid());
 #endif
     }
 }

+ 1 - 1
system/security/LdapSecurity/ldapconnection.cpp

@@ -1052,7 +1052,7 @@ public:
 
             for(int retries = 0; retries <= LDAPSEC_MAX_RETRIES; retries++)
             {
-                DBGLOG("LdapBind for user %s.", username, retries);
+                DBGLOG("LdapBind for user %s (retries=%d).", username, retries);
                 {
                     LDAP* user_ld = LdapUtils::LdapInit(m_ldapconfig->getProtocol(), hostbuf.str(), m_ldapconfig->getLdapPort(), m_ldapconfig->getLdapSecurePort());
                     rc = LdapUtils::LdapBind(user_ld, m_ldapconfig->getDomain(), username, password, userdnbuf.str(), m_ldapconfig->getServerType(), m_ldapconfig->getAuthMethod());

+ 2 - 2
system/security/LdapSecurity/ldapconnection.hpp

@@ -255,7 +255,7 @@ public:
             // Initialize an LDAP session
             if ((ld = ldap_init( (char*)host, port )) == NULL)
             {
-                throw MakeStringException(-1, "ldap_init error %s");
+                throw MakeStringException(-1, "ldap_init error");
             }
         }
         return ld;
@@ -381,7 +381,7 @@ public:
                 }
                 else
                 {
-                    DBGLOG("LDAP bind error for user %s with 0x%lx - %s", username, rc, ldap_err2string(rc));
+                    DBGLOG("LDAP bind error for user %s with 0x%"I64F"x - %s", username, (unsigned __int64) rc, ldap_err2string(rc));
                     return rc;
                 }
             }

+ 1 - 1
thorlcr/graph/thgraph.cpp

@@ -403,7 +403,7 @@ CGraphElementBase::CGraphElementBase(CGraphBase &_owner, IPropertyTree &_xgmml)
     xgmml->getProp("@id", helperName);
     helperFactory = (EclHelperFactory) queryJob().queryDllEntry().getEntry(helperName.str());
     if (!helperFactory)
-        throw MakeOsException(GetLastError(), "Failed to load helper factory method: %s (dll handle = %x)", helperName.str(), queryJob().queryDllEntry().getInstance());
+        throw MakeOsException(GetLastError(), "Failed to load helper factory method: %s (dll handle = %p)", helperName.str(), queryJob().queryDllEntry().getInstance());
     alreadyUpdated = false;
     whichBranch = (unsigned)-1;
     whichBranchBitSet.setown(createBitSet());

+ 1 - 1
thorlcr/thorutil/thalloc.cpp

@@ -347,7 +347,7 @@ public:
             PROGLOG("%s: %p, {cnt=%d,crc=%x,flg=%x} %u: %s",prefix?prefix:"row", row, (int)atomic_read(&h->count), (unsigned)h->extra, (unsigned)h->flags, us, s.str());
         }
         else 
-            PROGLOG("%s: NULL row",row);
+            PROGLOG("%s: NULL row",prefix?prefix:"row");
     }
 
 };

+ 1 - 1
thorlcr/thorutil/thormisc.cpp

@@ -829,7 +829,7 @@ memsize_t queryLargeMemSize()
             largeMemSize = globals->getPropInt("@largeMemSize") * 0x100000;
         else
             largeMemSize = DEFAULT_LARGEMEM_BUFFER_SIZE;
-        PROGLOG("Setting largemem to %d",largeMemSize);
+        PROGLOG("Setting largemem to %"I64F"d", (unsigned __int64) largeMemSize);
     }
     return largeMemSize;
 }

+ 3 - 3
tools/backupnode/backupnode.cpp

@@ -187,14 +187,14 @@ void syncFile(const char *src, const char *dst)
     offset_t srcsz;
     if (srcfile->getInfo(isdir,srcsz,srcdt)) { // ignore if not there
         if (isdir)
-            printerr("src file %s is directory, ignoring copy");
+            printerr("src file %s is directory, ignoring copy", src);
         else {
             Owned<IFile> dstfile = createIFile(dst);
             CDateTime dstdt;
             offset_t dstsz;
             if (dstfile->getInfo(isdir,dstsz,dstdt)) { // check if there
                 if (isdir) {
-                    printerr("dst file %s is directory, ignoring copy");
+                    printerr("dst file %s is directory, ignoring copy", dst);
                     return;
                 }
                 if ((srcsz==dstsz)&&srcdt.equals(dstdt,!inexactDateMatch))
@@ -648,7 +648,7 @@ int main(int argc, const char *argv[])
             if (!slaveNum || slaveNum>numSlaves)
             {
                 printerr("'%s' is not a valid slave number (range is 1 to %d)", args.item(1), numSlaves);
-                throw MakeStringException(-1, "'%s' is not a valid slave number (range is 1 to %d)", numSlaves);
+                throw MakeStringException(-1, "'%s' is not a valid slave number (range is 1 to %d)", args.item(1), numSlaves);
             }
             if (!forceSlaveIP)
             {

+ 1 - 1
tools/swapnode/swapnode.cpp

@@ -650,7 +650,7 @@ void swapNodeHistory(IPropertyTree *options,unsigned days,StringBuffer *out)
     if (out) 
         out->append("\nSwapped, Time, NodeNum, OutIp, InIp\n-----------------------------------\n");
     else {
-        PROGLOG("");
+        PROGLOG("%s", "");
         PROGLOG("Swapped, Time, NodeNum, OutIp, InIp");
         PROGLOG("-----------------------------------");
     }