Compilation fails on Arch (latest glibc, 2.25)

Bug #1692034 reported by troy engel
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
fatrace
New
Undecided
Unassigned

Bug Description

The compilation of fatrace is failing on Arch (glibc 2.25) with this output:

$ make
cc -O2 -g -Wall -Wextra -Werror -c -o fatrace.o fatrace.c
fatrace.c: In function ‘print_event’:
fatrace.c:138:13: error: 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>. [-Werror]
         snprintf (pathname, sizeof (pathname), "device %i:%i inode %ld\n", major (st.st_dev), minor (st.st_dev), st.st_ino);
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
fatrace.c:138:13: error: In the GNU C Library, "minor" 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 "minor", include <sys/sysmacros.h>
 directly. If you did not intend to use a system-defined macro
 "minor", you should undefine it after including <sys/types.h>. [-Werror]
         snprintf (pathname, sizeof (pathname), "device %i:%i inode %ld\n", major (st.st_dev), minor (st.st_dev), st.st_ino);
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
make: *** [<builtin>: fatrace.o] Error 1

Following the very well written instructions, simply updating to sys/sysmacros.h works as expected with no errors. Running the compiled binary is working fine after the change as well. As the version of gcc/glibc/etc. is always the newest on Arch I can only report what I have installed as of this moment:

$ pacman -Qo /usr/include/sys/sysmacros.h
/usr/include/sys/sysmacros.h is owned by glibc 2.25-1

$ pacman -Q gcc glibc
gcc 6.3.1-2
glibc 2.25-1

Thanks,
-te

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.