From e4819fdd459d812f06ac30bfe577258d6fab7684 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= Date: Fri, 16 Dec 2016 17:22:57 +0100 Subject: [PATCH] Include sys/sysmacros.h for major and minor macros (#776173) Glibc 2.25 is deprecating including . https://sourceware.org/git/?p=glibc.git;a=commitdiff;h=dbab6577c6684c62bd2521c1c29dc25c3cac966f Deprecate inclusion of by Building on Fedora Rawhide with Glibc 2.24.90 produces these warnings: BlockSpecial.cc:64:13: warning: In the GNU C Library, "major" is defined by . For historical compatibility, it is currently defined by as well, but we plan to remove this soon. To use "major", include directly. If you did not intend to use a system-defined macro "major", you should undefine it after including . m_major = major( sb.st_rdev ); ^~~~~~~~~~~~~~~~~~~~ BlockSpecial.cc:65:13: warning: In the GNU C Library, "minor" is defined by . For historical compatibility, it is currently defined by as well, but we plan to remove this soon. To use "minor", include directly. If you did not intend to use a system-defined macro "minor", you should undefine it after including . m_minor = minor( sb.st_rdev ); ^~~~~~~~~~~~~~~~~~~~ Code needing major and minor macros should include directly. As both Glibc and musl-libc have always provided this header and GParted is a Linux only application, just always include the header and don't bother with an autoconf check for its existence. Bug 776173 - Missing sys/sysmacros.h #include, needed for experimental glibc versions --- src/BlockSpecial.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/src/BlockSpecial.cc b/src/BlockSpecial.cc index 22062cf2..8f6f568e 100644 --- a/src/BlockSpecial.cc +++ b/src/BlockSpecial.cc @@ -19,6 +19,7 @@ #include #include #include +#include #include #include