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

Fix uninitialized variable in os_dup2_impl #76862

Closed
matrixise opened this issue Jan 26, 2018 · 4 comments
Closed

Fix uninitialized variable in os_dup2_impl #76862

matrixise opened this issue Jan 26, 2018 · 4 comments
Labels
3.7 (EOL) end of life

Comments

@matrixise
Copy link
Member

BPO 32681
Nosy @gpshead, @vstinner, @matrixise
PRs
  • bpo-32681: Fix an uninitialized variable in the C imp of os.dup2 #5346
  • 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 2018-01-30.06:05:06.614>
    created_at = <Date 2018-01-26.15:34:17.608>
    labels = ['3.7']
    title = 'Fix uninitialized variable in os_dup2_impl'
    updated_at = <Date 2018-01-30.06:05:06.613>
    user = 'https://github.com/matrixise'

    bugs.python.org fields:

    activity = <Date 2018-01-30.06:05:06.613>
    actor = 'gregory.p.smith'
    assignee = 'none'
    closed = True
    closed_date = <Date 2018-01-30.06:05:06.614>
    closer = 'gregory.p.smith'
    components = []
    creation = <Date 2018-01-26.15:34:17.608>
    creator = 'matrixise'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 32681
    keywords = ['patch']
    message_count = 4.0
    messages = ['310767', '310768', '310772', '311238']
    nosy_count = 3.0
    nosy_names = ['gregory.p.smith', 'vstinner', 'matrixise']
    pr_nums = ['5346']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue32681'
    versions = ['Python 3.7']

    @matrixise
    Copy link
    Member Author

    With the last revision, I get this warning from the compiler.

    gcc -pthread -Wno-unused-result -Wsign-compare -g -Og -Wall -Wstrict-prototypes    -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declaration   -I. -I./Include    -DPy_BUILD_CORE  -c ./Modules/_collectionsmodule.c -o Modules/_collectionsmodule.o
    ./Modules/posixmodule.c: In functionos_dup2_impl’:
    ./Modules/posixmodule.c:7785:9: warning: ‘resmay be used uninitialized in this function [-Wmaybe-uninitialized]
         int res;
             ^~~

    @vstinner
    Copy link
    Member

    I already reported the issue at:
    https://bugs.python.org/issue32441#msg310752

    I suggest to close this issue as a duplicate.

    @matrixise
    Copy link
    Member Author

    Yes, you can close it, but I don't understand why there is no fix for
    this warning. my issue has a small PR, but the other issue on b.p.o, I
    am not really sure about my fix... I just set the 'res' variable to 0
    and avoid this kind of message. Is there an other way if I want to fix
    it ?

    @matrixise matrixise added the 3.7 (EOL) end of life label Jan 26, 2018
    @gpshead
    Copy link
    Member

    gpshead commented Jan 30, 2018

    New changeset 3d86e48 by Gregory P. Smith (Stéphane Wirtel) in branch 'master':
    bpo-32681: Fix an uninitialized variable in the C implementation of os.dup2 (GH-5346)
    3d86e48

    @gpshead gpshead closed this as completed Jan 30, 2018
    @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
    Projects
    None yet
    Development

    No branches or pull requests

    3 participants