diff --git a/lib/cpp/test/concurrency/ThreadFactoryTests.h b/lib/cpp/test/concurrency/ThreadFactoryTests.h
index d7431a8..635c8a2 100644
--- a/lib/cpp/test/concurrency/ThreadFactoryTests.h
+++ b/lib/cpp/test/concurrency/ThreadFactoryTests.h
@@ -220,7 +220,7 @@
 
       try {
         monitor.wait(100);
-      } catch (TimedOutException& e) {
+      } catch (TimedOutException&) {
       }
 
       if (state == SynchStartTask::STARTED) {
@@ -257,7 +257,7 @@
         Synchronized s(monitor);
         try {
           monitor.wait(timeout);
-        } catch (TimedOutException& e) {
+        } catch (TimedOutException&) {
         }
       }
     }
diff --git a/lib/cpp/test/concurrency/ThreadManagerTests.h b/lib/cpp/test/concurrency/ThreadManagerTests.h
index 904948c..08e8179 100644
--- a/lib/cpp/test/concurrency/ThreadManagerTests.h
+++ b/lib/cpp/test/concurrency/ThreadManagerTests.h
@@ -56,7 +56,7 @@
 
         try {
           _sleep.wait(_timeout);
-        } catch (TimedOutException& e) {
+        } catch (TimedOutException&) {
           ;
         } catch (...) {
           assert(0);
@@ -183,7 +183,7 @@
               << "ms min: " << minTime << "ms max: " << maxTime << "ms average: " << averageTime
               << "ms" << std::endl;
 
-    double expectedTime = ((count + (workerCount - 1)) / workerCount) * timeout;
+    double expectedTime = (double(count + (workerCount - 1)) / workerCount) * timeout;
 
     double error = ((time01 - time00) - expectedTime) / expectedTime;
 
@@ -290,18 +290,18 @@
       try {
         threadManager->add(extraTask, 1);
         throw TException("Unexpected success adding task in excess of pending task count");
-      } catch (TooManyPendingTasksException& e) {
+      } catch (TooManyPendingTasksException&) {
         throw TException("Should have timed out adding task in excess of pending task count");
-      } catch (TimedOutException& e) {
+      } catch (TimedOutException&) {
         // Expected result
       }
 
       try {
         threadManager->add(extraTask, -1);
         throw TException("Unexpected success adding task in excess of pending task count");
-      } catch (TimedOutException& e) {
+      } catch (TimedOutException&) {
         throw TException("Unexpected timeout adding task in excess of pending task count");
-      } catch (TooManyPendingTasksException& e) {
+      } catch (TooManyPendingTasksException&) {
         // Expected result
       }
 
@@ -327,12 +327,12 @@
 
       try {
         threadManager->add(extraTask, 1);
-      } catch (TimedOutException& e) {
+      } catch (TimedOutException&) {
         std::cout << "\t\t\t"
                   << "add timed out unexpectedly" << std::endl;
         throw TException("Unexpected timeout adding task");
 
-      } catch (TooManyPendingTasksException& e) {
+      } catch (TooManyPendingTasksException&) {
         std::cout << "\t\t\t"
                   << "add encountered too many pending exepctions" << std::endl;
         throw TException("Unexpected timeout adding task");
diff --git a/lib/cpp/test/concurrency/TimerManagerTests.h b/lib/cpp/test/concurrency/TimerManagerTests.h
index dda16ed..f4600fc 100644
--- a/lib/cpp/test/concurrency/TimerManagerTests.h
+++ b/lib/cpp/test/concurrency/TimerManagerTests.h
@@ -58,7 +58,7 @@
 
       delta = delta > _timeout ? delta - _timeout : _timeout - delta;
 
-      float error = delta / _timeout;
+      double error = double(delta) / _timeout;
 
       if (error < TEST_TOLERANCE) {
         _success = true;
@@ -119,7 +119,7 @@
           _monitor.wait(1000);
           assert(
               0 == "ERROR: This wait should time out. TimerManager dispatcher may have a problem.");
-        } catch (TimedOutException& ex) {
+        } catch (TimedOutException&) {
         }
 
         task.reset(new TimerManagerTests::Task(_monitor, timeout));
