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

gcc 10 emits warning for unused function: _xxsubinterpretersmodule #84793

Closed
corona10 opened this issue May 13, 2020 · 5 comments
Closed

gcc 10 emits warning for unused function: _xxsubinterpretersmodule #84793

corona10 opened this issue May 13, 2020 · 5 comments
Labels
3.9 only security fixes topic-C-API type-feature A feature request or enhancement

Comments

@corona10
Copy link
Member

BPO 40613
Nosy @vstinner, @ericsnowcurrently, @corona10
PRs
  • bpo-40613: Remove compiler warning from _xxsubinterpretersmodule #20069
  • 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 2020-05-13.13:39:53.782>
    created_at = <Date 2020-05-13.06:26:16.167>
    labels = ['expert-C-API', 'type-feature', '3.9']
    title = 'gcc 10 emits warning for unused function: _xxsubinterpretersmodule'
    updated_at = <Date 2020-05-14.16:46:31.529>
    user = 'https://github.com/corona10'

    bugs.python.org fields:

    activity = <Date 2020-05-14.16:46:31.529>
    actor = 'vstinner'
    assignee = 'none'
    closed = True
    closed_date = <Date 2020-05-13.13:39:53.782>
    closer = 'corona10'
    components = ['C API']
    creation = <Date 2020-05-13.06:26:16.167>
    creator = 'corona10'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 40613
    keywords = ['patch']
    message_count = 5.0
    messages = ['368762', '368777', '368783', '368784', '368848']
    nosy_count = 3.0
    nosy_names = ['vstinner', 'eric.snow', 'corona10']
    pr_nums = ['20069']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue40613'
    versions = ['Python 3.9']

    @corona10
    Copy link
    Member Author

    /oss/cpython/Modules/_xxsubinterpretersmodule.c:1089:1: warning: ‘_sharedexception_is_clear’ defined but not used [-Wunused-function]
    1089 | _sharedexception_is_clear(_sharedexception *she)
    | ^~~~~~~~~~~~~~~~~~~~~~~~~
    /oss/cpython/Modules/_xxsubinterpretersmodule.c:601:1: warning: ‘_tbsnapshot_is_clear’ defined but not used [-Wunused-function]
    601 | _tbsnapshot_is_clear(_tbsnapshot *tbs)
    | ^~~~~~~~~~~~~~~~~~~~

    Both functions are used by the assert statement.
    IMHO, it should be replaced by if statement.

    @corona10 corona10 added 3.9 only security fixes topic-C-API type-feature A feature request or enhancement labels May 13, 2020
    @corona10 corona10 changed the title gcc 10 emits error for unused function: _xxsubinterpretersmodule gcc 10 emits warning for unused function: _xxsubinterpretersmodule May 13, 2020
    @corona10 corona10 changed the title gcc 10 emits error for unused function: _xxsubinterpretersmodule gcc 10 emits warning for unused function: _xxsubinterpretersmodule May 13, 2020
    @vstinner
    Copy link
    Member

    The two functions are only used in assertions. They should be surrounded by "#ifndef NDEBUG (...) #endif".

    @corona10
    Copy link
    Member Author

    New changeset fa0a66e by Dong-hee Na in branch 'master':
    bpo-40613: Remove compiler warning from _xxsubinterpretersmodule (GH-20069)
    fa0a66e

    @corona10
    Copy link
    Member Author

    The issue is now fixed.
    The PR was tested by me and Victor.

    Thanks for the suggestion and review Victor!

    @vstinner
    Copy link
    Member

    New changeset f2c3b68 by Victor Stinner in branch 'master':
    Revert "bpo-32604: [_xxsubinterpreters] Propagate exceptions. (GH-19768)" (GH-20089)
    f2c3b68

    @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.9 only security fixes topic-C-API type-feature A feature request or enhancement
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants