diff --git a/Source/ctest.cxx b/Source/ctest.cxx
index dfc18a1d14ce8c0aed2a4f248396be896ef6fc5b..1b87f7948d0ec0822cda6e3b45cdcb174c75d289 100644
--- a/Source/ctest.cxx
+++ b/Source/ctest.cxx
@@ -574,7 +574,7 @@ int ctest::BuildDirectory()
       }
     if ( found )
       {
-      errorwarning.m_LogLine     = kk;
+      errorwarning.m_LogLine     = static_cast<int>(kk);
       errorwarning.m_Text        = lines[kk];
       errorwarning.m_PreContext  = "";
       errorwarning.m_PostContext = "";