diff mbox series

[09/38] lib/blkid: fix -Wunused-variable warning in blkid_get_dev_size()

Message ID 20230121203230.27624-10-ebiggers@kernel.org
State Accepted
Headers show
Series e2fsprogs: misc fixes, and add a GitHub Actions file | expand

Commit Message

Eric Biggers Jan. 21, 2023, 8:32 p.m. UTC
From: Eric Biggers <ebiggers@google.com>

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 <ebiggers@google.com>
---
 lib/blkid/Android.bp | 1 -
 lib/blkid/getsize.c  | 2 +-
 2 files changed, 1 insertion(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/lib/blkid/Android.bp b/lib/blkid/Android.bp
index a40113193..f5d25da4f 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 75f21d5c1..7a6e6fd86 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 */