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

Include major(), minor(), makedev() from sysmacros #75524

Closed
tiran opened this issue Sep 4, 2017 · 5 comments
Closed

Include major(), minor(), makedev() from sysmacros #75524

tiran opened this issue Sep 4, 2017 · 5 comments
Labels
3.7 (EOL) end of life build The build process and cross-build extension-modules C modules in the Modules dir

Comments

@tiran
Copy link
Member

tiran commented Sep 4, 2017

BPO 31343
Nosy @tiran, @serhiy-storchaka
PRs
  • bpo-31343: Include sys/sysmacros.h #3318
  • [3.6] bpo-31343: Include sys/sysmacros.h (GH-3318) #3344
  • [2.7] bpo-31343: Include sys/sysmacros.h (GH-3318) #3345
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2017-09-05.15:09:27.675>
    created_at = <Date 2017-09-04.21:50:37.081>
    labels = ['extension-modules', 'build', '3.7']
    title = 'Include major(), minor(), makedev() from sysmacros'
    updated_at = <Date 2017-10-17.22:02:24.383>
    user = 'https://github.com/tiran'

    bugs.python.org fields:

    activity = <Date 2017-10-17.22:02:24.383>
    actor = 'fweimer'
    assignee = 'none'
    closed = True
    closed_date = <Date 2017-09-05.15:09:27.675>
    closer = 'christian.heimes'
    components = ['Extension Modules']
    creation = <Date 2017-09-04.21:50:37.081>
    creator = 'christian.heimes'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 31343
    keywords = []
    message_count = 5.0
    messages = ['301272', '301311', '301315', '301316', '304501']
    nosy_count = 3.0
    nosy_names = ['christian.heimes', 'serhiy.storchaka', 'fweimer']
    pr_nums = ['3318', '3344', '3345']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'compile error'
    url = 'https://bugs.python.org/issue31343'
    versions = ['Python 2.7', 'Python 3.6', 'Python 3.7']

    @tiran
    Copy link
    Member Author

    tiran commented 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 tiran added 3.7 (EOL) end of life extension-modules C modules in the Modules dir build The build process and cross-build labels Sep 4, 2017
    @tiran
    Copy link
    Member Author

    tiran commented Sep 5, 2017

    New changeset 75b9618 by Christian Heimes in branch 'master':
    bpo-31343: Include sys/sysmacros.h (bpo-3318)
    75b9618

    @tiran
    Copy link
    Member Author

    tiran commented 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
    Copy link
    Member Author

    tiran commented 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

    @tiran tiran closed this as completed Sep 5, 2017
    @serhiy-storchaka
    Copy link
    Member

    Louie Lu proposed the fix for this issue in bpo-30013.

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.7 (EOL) end of life build The build process and cross-build extension-modules C modules in the Modules dir
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants