From 8eb4a1d71d539a3867b4ddc1ab7c924b033218a6 Mon Sep 17 00:00:00 2001 From: Eric Biggers Date: Sat, 21 Jan 2023 12:32:01 -0800 Subject: [PATCH] lib/blkid: fix -Wunused-variable warning in blkid_get_dev_size() This showed up when building for Windows. It's hard to conditionally define this variable, so use the 'unused' attribute. Signed-off-by: Eric Biggers Signed-off-by: Theodore Ts'o --- lib/blkid/Android.bp | 1 - lib/blkid/getsize.c | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/blkid/Android.bp b/lib/blkid/Android.bp index a401131..f5d25da 100644 --- a/lib/blkid/Android.bp +++ b/lib/blkid/Android.bp @@ -42,7 +42,6 @@ cc_library { include_dirs: ["external/e2fsprogs/include/mingw"], cflags: [ "-Wno-pointer-to-int-cast", - "-Wno-unused-variable", "-Wno-error=typedef-redefinition", ], diff --git a/lib/blkid/getsize.c b/lib/blkid/getsize.c index 75f21d5..7a6e6fd 100644 --- a/lib/blkid/getsize.c +++ b/lib/blkid/getsize.c @@ -75,7 +75,7 @@ static int valid_offset(int fd, blkid_loff_t offset) */ blkid_loff_t blkid_get_dev_size(int fd) { - unsigned long long size64; + unsigned long long size64 __BLKID_ATTR((unused)); blkid_loff_t high, low; #if defined DKIOCGETBLOCKCOUNT && defined DKIOCGETBLOCKSIZE /* For Apple Darwin */ -- 1.8.3.1