Ticket #3857 (closed defect: fixed)

Opened 7 years ago

Last modified 7 years ago

makedev vs. sys/types.h warning

Reported by: egmont Owned by: andrew_b
Priority: minor Milestone: 4.8.21
Component: mc-core Version: master
Keywords: Cc:
Blocked By: Blocking:
Branch state: merged Votes for changeset: committed-master

Description

Beginning with glibc-2.25, compilation gives these kinds of warnings:

parse_ls_vga.c:790:13: warning: 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 undefine it after including <sys/types.h>.
         s->st_rdev = makedev (maj, min);
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~        

There are a total of 10 of them, some with makedev(), some with major() or minor():

lib/vfs/parse_ls_vga.c:790 makedev()
src/filemanager/info.c:231 major() and minor()
src/filemanager/mountlist.c:751 makedev()
src/filemanager/panel.c:489-490 major() and minor()
src/vfs/cpio/cpio.c:741 and 748 makedev()
src/vfs/fish/fish.c:864 makedev()
src/vfs/tar/tar.c:429 makedev()

Attachments

mc-3857-workaround-autoconf-header-major.patch (1.7 KB) - added by and 7 years ago.

Change History

comment:1 Changed 7 years ago by egmont

configure.ac contains AC_HEADER_MAJOR.

This, as far as I understand, expands based on the contents of /usr/share/autoconf to some stuff in configure which checks if these three functions are available in <sys/types.h>, and if they are, this is getting used. Otherwise MAJOR_IN_SYSMACROS would get defined in config.h (which would be what we need), but this way it doesn't.

So if glibc will remove these from <sys/types.h> I guess we'll still be fine, we'd automatically locate them in <sys/sysmacros.h>.

Not sure if we can do anything reasonable about the warning (some nasty-nasty workaround, sure). I guess it should be fixed in autoconf.

Autoconf's newest version (2.69) is 5+ years old, ouch.

Changed 7 years ago by and

comment:3 Changed 7 years ago by andrew_b

What about usage of gnulib module?

comment:4 Changed 7 years ago by andrew_b

  • Owner set to andrew_b
  • Status changed from new to accepted
  • Branch state changed from no branch to on review
  • Milestone changed from Future Releases to 4.8.21

comment:5 Changed 7 years ago by andrew_b

  • Votes for changeset set to andrew_b
  • Branch state changed from on review to approved

comment:6 Changed 7 years ago by andrew_b

  • Votes for changeset changed from andrew_b to committed-master
  • Branch state changed from approved to merged

comment:7 Changed 7 years ago by andrew_b

  • Status changed from accepted to testing
  • Resolution set to fixed

comment:8 Changed 7 years ago by andrew_b

  • Status changed from testing to closed
Note: See TracTickets for help on using tickets.