]> Savannah Git Hosting - gnulib.git/commitdiff
mountlist: include sysmacros.h for glibc
authorEric Blake <eblake@redhat.com>
Thu, 15 Sep 2016 00:21:42 +0000 (19:21 -0500)
committerEric Blake <eblake@redhat.com>
Thu, 15 Sep 2016 17:39:08 +0000 (12:39 -0500)
On Fedora rawhide (glibc 2.25), './gnulib-tool --test mountlist'
reports:
../../gllib/mountlist.c: In function 'read_file_system_list':
../../gllib/mountlist.c:534:13: warning: '__makedev_from_sys_types' is deprecated:
  In the GNU C Library, `makedev' 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 `makedev', include <sys/sysmacros.h> directly.
  If you did not intend to use a system-defined macro `makedev',
  you should #undef it after including <sys/types.h>.
  [-Wdeprecated-declarations]
             me->me_dev = makedev (devmaj, devmin);
             ^~
In file included from /usr/include/features.h:397:0,
                 from /usr/include/sys/types.h:25,
                 from ./sys/types.h:28,
                 from ../../gllib/mountlist.h:23,
                 from ../../gllib/mountlist.c:20:
/usr/include/sys/sysmacros.h:89:1: note: declared here
 __SYSMACROS_DEFINE_MAKEDEV (__SYSMACROS_FST_IMPL_TEMPL)
 ^

Fix it by including the right headers.  We also need a fix to
autoconf's AC_HEADER_MAJOR, but that's a separate patch.

* m4/mountlist.m4 (gl_PREREQ_MOUTLIST_EXTRA): Include
AC_HEADER_MAJOR.
* lib/mountlist.c (includes): Use correct headers.

Signed-off-by: Eric Blake <eblake@redhat.com>
ChangeLog
lib/mountlist.c
m4/mountlist.m4

index b3247dff69fa81a9b2aafacc0ac3600998d4ea52..1362beae4a181baeff047ad80e661ad036ee4143 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2016-09-15  Eric Blake  <eblake@redhat.com>
+
+       mountlist: include sysmacros.h for glibc
+       * m4/mountlist.m4 (gl_PREREQ_MOUTLIST_EXTRA): Include
+       AC_HEADER_MAJOR.
+       * lib/mountlist.c (includes): Use correct headers.
+
 2016-09-15  Paul Eggert  <eggert@cs.ucla.edu>
 
        extensions: port to more ISO C TSes
index bb4e4ee210978cd0dbfe6c50f49dae943634fe7d..cf4020e2ab75a5be0dd68f9b70a28eb4e87f569d 100644 (file)
 # include <sys/param.h>
 #endif
 
+#if MAJOR_IN_MKDEV
+# include <sys/mkdev.h>
+#elif MAJOR_IN_SYSMACROS
+# include <sys/sysmacros.h>
+#endif
+
 #if defined MOUNTED_GETFSSTAT   /* OSF_1 and Darwin1.3.x */
 # if HAVE_SYS_UCRED_H
 #  include <grp.h> /* needed on OSF V4.0 for definition of NGROUPS,
index 2e2ca37fbf0c8b7d3d79bd077ecb93acb742af3f..b6724fa33b8702619b0ecf1a033db1ccd94cdf56 100644 (file)
@@ -1,4 +1,4 @@
-# serial 11
+# serial 12
 dnl Copyright (C) 2002-2006, 2009-2016 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -15,5 +15,6 @@ AC_DEFUN([gl_PREREQ_MOUNTLIST_EXTRA],
 [
   dnl Note gl_LIST_MOUNTED_FILE_SYSTEMS checks for mntent.h, not sys/mntent.h.
   AC_CHECK_HEADERS([sys/mntent.h])
+  AC_HEADER_MAJOR()dnl for use of makedev ()
   gl_FSTYPENAME
 ])