[PATCH] xfstests: include <sys/sysmacros.h> for major() and minor()

[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]



From: Eric Biggers <ebiggers@xxxxxxxxxx>

This resolves the following deprecation warning (and other instances of
the same warning) when compiling with glibc 2.25 or later:

stat_test.c: In function 'cmp_statx':
stat_test.c:251:13: warning: In the GNU C Library, "major" is defined
 by <sys/sysmacros.h>. For historical compatibility, it is
 currently defined by <sys/types.h> as well, but we plan to
 remove this soon. To use "major", include <sys/sysmacros.h>
 directly. If you did not intend to use a system-defined macro
 "major", you should undefine it after including <sys/types.h>.
  devcmp(dev);
             ^

Signed-off-by: Eric Biggers <ebiggers@xxxxxxxxxx>
---
 src/fssum.c     | 1 +
 src/stat_test.c | 1 +
 2 files changed, 2 insertions(+)

diff --git a/src/fssum.c b/src/fssum.c
index 88e75621..04052cdc 100644
--- a/src/fssum.c
+++ b/src/fssum.c
@@ -31,6 +31,7 @@
 #include <errno.h>
 #include <sys/types.h>
 #include <sys/stat.h>
+#include <sys/sysmacros.h>
 #ifdef __SOLARIS__
 #include <sys/mkdev.h>
 #endif
diff --git a/src/stat_test.c b/src/stat_test.c
index fc87ed5c..198c1332 100644
--- a/src/stat_test.c
+++ b/src/stat_test.c
@@ -19,6 +19,7 @@
 #include <fcntl.h>
 #include <sys/types.h>
 #include <sys/stat.h>
+#include <sys/sysmacros.h>
 #include "statx.h"
 
 static bool failed = false;
-- 
2.13.3

--
To unsubscribe from this list: send the line "unsubscribe fstests" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Filesystems Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux