]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
repart: mark an assert()-only variable as unused 20738/head
authorFrantisek Sumsal <frantisek@sumsal.cz>
Wed, 15 Sep 2021 13:46:19 +0000 (15:46 +0200)
committerFrantisek Sumsal <frantisek@sumsal.cz>
Wed, 15 Sep 2021 13:46:19 +0000 (15:46 +0200)
otherwise compilation with -Db_ndebug=true complains about a
set-but-not-used variable:

```
 ../src/partition/repart.c:907:33: error: variable 'left' set but not used [-Werror,-Wunused-but-set-variable]
                 uint64_t start, left;
                                                 ^
                                                 1 error generated.
```

src/partition/repart.c

index bf6bac07c516d39e71050d0f303d38c8a9deb591..0d1eebec25620dc6adcaa2cab55ab9e81f201963 100644 (file)
@@ -899,7 +899,8 @@ static void context_place_partitions(Context *context) {
 
         for (size_t i = 0; i < context->n_free_areas; i++) {
                 FreeArea *a = context->free_areas[i];
-                uint64_t start, left;
+                _unused_ uint64_t left;
+                uint64_t start;
 
                 if (a->after) {
                         assert(a->after->offset != UINT64_MAX);