about summary refs log tree commit diff
path: root/src/libmain
diff options
context:
space:
mode:
Diffstat (limited to 'src/libmain')
-rw-r--r--src/libmain/shared.cc11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/libmain/shared.cc b/src/libmain/shared.cc
index 2441cbf0139d..71be0dd5d0ef 100644
--- a/src/libmain/shared.cc
+++ b/src/libmain/shared.cc
@@ -44,13 +44,10 @@ Path makeRootName(const Path & gcRoot, int & counter)
 
 void printGCWarning()
 {
-    static bool warned = false;
-    if (!warned) {
-        printMsg(lvlInfo,
-            "warning: you did not specify `--add-root'; "
-            "the result might be removed by the garbage collector");
-        warned = true;
-    }
+    static bool haveWarned = false;
+    warnOnce(haveWarned, 
+        "warning: you did not specify `--add-root'; "
+        "the result might be removed by the garbage collector");
 }