diff --git a/projects/clr/rocclr/utils/debug.cpp b/projects/clr/rocclr/utils/debug.cpp index c0bd74201d..0fc8889987 100644 --- a/projects/clr/rocclr/utils/debug.cpp +++ b/projects/clr/rocclr/utils/debug.cpp @@ -40,13 +40,14 @@ namespace amd { FILE* outFile = stderr; -const size_t maxLogSize = AMD_LOG_LEVEL_SIZE * Mi; // ================================================================================================ void truncate_log_file() { if (outFile != stderr) { fseek(outFile, 0, SEEK_END); long size = ftell(outFile); + + const size_t maxLogSize = AMD_LOG_LEVEL_SIZE * Mi; if (size > maxLogSize) { if (nullptr == freopen(NULL, "w", outFile)) { outFile = stderr;