Skip to content

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

Closed

Description

@tiran
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']

    Activity

    1. tiran commented on Sep 4, 2017

      @tiran
      MemberAuthor

      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);
      ^~~~~~~~~~~~~~~~~~~~~

    2. added
      3.7 (EOL)
      extension-modules
      build
      on Sep 4, 2017
    3. tiran commented on Sep 5, 2017

      @tiran
      MemberAuthor

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

    4. tiran commented on Sep 5, 2017

      @tiran
      MemberAuthor

      New changeset ffa7011 by Christian Heimes in branch '2.7':
      [2.7] bpo-31343: Include sys/sysmacros.h (GH-3318) (bpo-3345)
      ffa7011

    5. tiran commented on Sep 5, 2017

      @tiran
      MemberAuthor

      New changeset 02854da by Christian Heimes in branch '3.6':
      [3.6] bpo-31343: Include sys/sysmacros.h (GH-3318) (bpo-3344)
      02854da

    6. serhiy-storchaka commented on Oct 17, 2017

      @serhiy-storchaka
      Member

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

    7. transferred this issue fromon Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Assignees

    No one assigned

      Labels

      3.7 (EOL)buildextension-modules

      Projects

      No projects

        Milestone

        No milestone

        Relationships

        None yet

        Development

        No branches or pull requests

        Issue actions