diff --git a/core/base/src/TSystem.cxx b/core/base/src/TSystem.cxx
index e1a633f52ecac24f456582e9a3c58f5be25c4a85..ffa2102c668c8559033e4113fd08dc2560c4e0f1 100644
--- a/core/base/src/TSystem.cxx
+++ b/core/base/src/TSystem.cxx
@@ -2844,7 +2844,7 @@ int TSystem::CompileMacro(const char *filename, Option_t *opt,
       AssignAndDelete(file, ConcatFileName(gSystem->HomeDirectory(), name) );
       mapfileStream << file << endl;
       mapfileStream << name << endl;
-      for (int i = 0; i < gInterpreter->GetRootMapFiles()->GetEntriesFast(); i++) {
+      for (i = 0; i < gInterpreter->GetRootMapFiles()->GetEntriesFast(); i++) {
          mapfileStream << ((TObjString*)gInterpreter->GetRootMapFiles()->At(i))->GetString() << endl;
       }
    }