about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/libmain/stack.cc2
-rw-r--r--src/libstore/local-store.cc2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/libmain/stack.cc b/src/libmain/stack.cc
index 41b617d98be2..abf59dc4baa6 100644
--- a/src/libmain/stack.cc
+++ b/src/libmain/stack.cc
@@ -32,7 +32,7 @@ static void sigsegvHandler(int signo, siginfo_t * info, void * ctx)
         if (diff < 0) diff = -diff;
         if (diff < 4096) {
             char msg[] = "error: stack overflow (possible infinite recursion)\n";
-            (void) write(2, msg, strlen(msg));
+            [[gnu::unused]] int res = write(2, msg, strlen(msg));
             _exit(1); // maybe abort instead?
         }
     }
diff --git a/src/libstore/local-store.cc b/src/libstore/local-store.cc
index 4f2c433b88d1..ed5747f3132a 100644
--- a/src/libstore/local-store.cc
+++ b/src/libstore/local-store.cc
@@ -124,7 +124,7 @@ LocalStore::LocalStore(const Params & params)
 #endif
             if (res == -1) {
                 writeFull(fd.get(), string(settings.reservedSize, 'X'));
-                ftruncate(fd.get(), settings.reservedSize);
+                [[gnu::unused]] auto res2 = ftruncate(fd.get(), settings.reservedSize);
             }
         }
     } catch (SysError & e) { /* don't care about errors */