Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

makedev vs. sys/types.h warning #3857

Closed
mc-butler opened this issue Sep 22, 2017 · 9 comments
Closed

makedev vs. sys/types.h warning #3857

mc-butler opened this issue Sep 22, 2017 · 9 comments
Assignees
Labels
area: core Issues not related to a specific subsystem prio: low Minor problem or easily worked around
Milestone

Comments

@mc-butler
Copy link

Important

This issue was migrated from Trac:

Origin https://midnight-commander.org/ticket/3857
Reporter egmont (@egmontkob)

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()

Note

Original attachments:

@mc-butler
Copy link
Author

Changed by egmont (@egmontkob) on Sep 22, 2017 at 17:00 UTC (comment 1)

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.

@mc-butler
Copy link
Author

Changed by andrew_b (@aborodin) on Sep 22, 2017 at 17:22 UTC (comment 2)

http://git.savannah.gnu.org/cgit/gnulib.git/tree/m4/sys_types_h.m4

@mc-butler
Copy link
Author

Changed by and on Jan 3, 2018 at 22:25 UTC

@mc-butler
Copy link
Author

Changed by andrew_b (@aborodin) on Jan 4, 2018 at 5:04 UTC (comment 3)

What about usage of gnulib module?

@mc-butler
Copy link
Author

Changed by andrew_b (@aborodin) on Jan 4, 2018 at 6:27 UTC (comment 4)

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

Branch: 3857_mekedev
[30b6ed6b4ec7615a407bff0b33629c6171e4dc82]

@mc-butler
Copy link
Author

Changed by andrew_b (@aborodin) on Jan 20, 2018 at 7:55 UTC (comment 5)

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

@mc-butler
Copy link
Author

Changed by andrew_b (@aborodin) on Jan 20, 2018 at 7:58 UTC (comment 6)

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

Merged to master: [1782809].

@mc-butler
Copy link
Author

Changed by andrew_b (@aborodin) on Jan 20, 2018 at 7:59 UTC (comment 7)

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

@mc-butler
Copy link
Author

Changed by andrew_b (@aborodin) on Jan 20, 2018 at 8:00 UTC (comment 8)

  • Status changed from testing to closed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: core Issues not related to a specific subsystem prio: low Minor problem or easily worked around
Development

No branches or pull requests

2 participants