[CRIU] [PATCH 1/1] build: get rid of warnings with sysmacro

asml.silence at gmail.com asml.silence at gmail.com
Sat Oct 21 17:12:50 MSK 2017


From: Pavel Begunkov <asml.silence at gmail.com>

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>.
  if (major(st.st_rdev) != major(st_rtc.st_rdev) ||

Signed-off-by: Pavel Begunkov <asml.silence at gmail.com>
---
 criu/kerndat.c              | 1 -
 test/zdtm/static/criu-rtc.c | 1 +
 2 files changed, 1 insertion(+), 1 deletion(-)

diff --git a/criu/kerndat.c b/criu/kerndat.c
index 747b9a1a..b71df1c7 100644
--- a/criu/kerndat.c
+++ b/criu/kerndat.c
@@ -8,7 +8,6 @@
 #include <errno.h>
 #include <sys/syscall.h>
 #include <sys/sysmacros.h>
-#include <sys/sysmacros.h>
 #include <stdint.h>
 #include <sys/socket.h>
 #include <arpa/inet.h>  /* for sockaddr_in and inet_ntoa() */
diff --git a/test/zdtm/static/criu-rtc.c b/test/zdtm/static/criu-rtc.c
index 0d6ffeac..8588f9f5 100644
--- a/test/zdtm/static/criu-rtc.c
+++ b/test/zdtm/static/criu-rtc.c
@@ -1,6 +1,7 @@
 #include <stdio.h>
 #include <linux/rtc.h>
 #include <sys/ioctl.h>
+#include <sys/sysmacros.h>
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>
-- 
2.14.1.473.g3ec7d702a8



More information about the CRIU mailing list