diff --git a/SystemInformation.cxx b/SystemInformation.cxx
index 127a04822670ec88fac10ebf1ce8b14b902e870f..c33d7383ff05a032744a96f8812835312a105aec 100644
--- a/SystemInformation.cxx
+++ b/SystemInformation.cxx
@@ -4632,7 +4632,7 @@ std::string SystemInformationImplementation::RunProcess(std::vector<const char*>
   double timeout = 255;
   int pipe; // pipe id as returned by kwsysProcess_WaitForData()
 
-  while( ( pipe = kwsysProcess_WaitForData(gp,&data,&length,&timeout),
+  while( ( static_cast<void>(pipe = kwsysProcess_WaitForData(gp,&data,&length,&timeout)),
            (pipe == kwsysProcess_Pipe_STDOUT || pipe == kwsysProcess_Pipe_STDERR) ) ) // wait for 1s
     {
       buffer.append(data, length);
diff --git a/SystemTools.cxx b/SystemTools.cxx
index 544a638cab7ea254ac309db6ae2d42b5f45a55fd..0c7f4194f4de3b4712d452ff0b0c882ba7d9806d 100644
--- a/SystemTools.cxx
+++ b/SystemTools.cxx
@@ -4758,8 +4758,9 @@ bool SystemTools::GetLineFromStream(std::istream& is,
   // been reached.  Clear the fail bit just before reading.
   while(!haveNewline &&
         leftToRead != 0 &&
-        (is.clear(is.rdstate() & ~std::ios::failbit),
-         is.getline(buffer, bufferSize), is.gcount() > 0))
+        (static_cast<void>(is.clear(is.rdstate() & ~std::ios::failbit)),
+         static_cast<void>(is.getline(buffer, bufferSize)),
+         is.gcount() > 0))
     {
     // We have read at least one byte.
     haveData = true;