Whamcloud - gitweb
lib/blkid: fix -Wunused-variable warning in blkid_get_dev_size()
authorEric Biggers <ebiggers@google.com>
Sat, 21 Jan 2023 20:32:01 +0000 (12:32 -0800)
committerTheodore Ts'o <tytso@mit.edu>
Fri, 27 Jan 2023 17:33:59 +0000 (12:33 -0500)
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>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
lib/blkid/Android.bp
lib/blkid/getsize.c

index a401131..f5d25da 100644 (file)
@@ -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",
             ],
 
index 75f21d5..7a6e6fd 100644 (file)
@@ -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 */