You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Include major(), minor(), makedev() from sysmacros #75524
On Fedora 26, GCC is emitting warnings because we are using minor(), major() and makedev()
from sys/types.h. The macros should be included from sys/sysmacros.h instead:
./Modules/posixmodule.c: In function ‘os_major_impl’:
./Modules/posixmodule.c:8758:13: warning: 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>.
return major(device);
^~~~~~~~~~~~~
./Modules/posixmodule.c: In function ‘os_minor_impl’:
./Modules/posixmodule.c:8775:13: warning: 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>.
return minor(device);
^~~~~~~~~~~~~
./Modules/posixmodule.c: In function ‘os_makedev_impl’:
./Modules/posixmodule.c:8793: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>.
return makedev(major, minor);
^~~~~~~~~~~~~~~~~~~~~
Activity
tiran commentedon Sep 4, 2017
On Fedora 26, GCC is emitting warnings because we are using minor(), major() and makedev()
from sys/types.h. The macros should be included from sys/sysmacros.h instead:
./Modules/posixmodule.c: In function ‘os_major_impl’:
./Modules/posixmodule.c:8758:13: warning: 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>.
return major(device);
^~~~~~~~~~~~~
./Modules/posixmodule.c: In function ‘os_minor_impl’:
./Modules/posixmodule.c:8775:13: warning: 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>.
return minor(device);
^~~~~~~~~~~~~
./Modules/posixmodule.c: In function ‘os_makedev_impl’:
./Modules/posixmodule.c:8793: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>.
return makedev(major, minor);
^~~~~~~~~~~~~~~~~~~~~
tiran commentedon Sep 5, 2017
New changeset 75b9618 by Christian Heimes in branch 'master':
bpo-31343: Include sys/sysmacros.h (bpo-3318)
75b9618
tiran commentedon Sep 5, 2017
New changeset ffa7011 by Christian Heimes in branch '2.7':
[2.7] bpo-31343: Include sys/sysmacros.h (GH-3318) (bpo-3345)
ffa7011
tiran commentedon Sep 5, 2017
New changeset 02854da by Christian Heimes in branch '3.6':
[3.6] bpo-31343: Include sys/sysmacros.h (GH-3318) (bpo-3344)
02854da
serhiy-storchaka commentedon Oct 17, 2017
Louie Lu proposed the fix for this issue in bpo-30013.