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

[2.7] Fix -Wnonnull and -Wint-in-bool-context warnings #75655

Closed
tiran opened this issue Sep 14, 2017 · 3 comments
Closed

[2.7] Fix -Wnonnull and -Wint-in-bool-context warnings #75655

tiran opened this issue Sep 14, 2017 · 3 comments
Assignees
Labels
build The build process and cross-build

Comments

@tiran
Copy link
Member

tiran commented Sep 14, 2017

BPO 31474
Nosy @tiran, @zware
PRs
  • bpo-31474: Fix -Wint-in-bool-context warnings #3581
  • 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 = 'https://github.com/tiran'
    closed_at = <Date 2020-04-27.03:27:58.010>
    created_at = <Date 2017-09-14.17:37:30.102>
    labels = ['build']
    title = '[2.7] Fix  -Wnonnull and -Wint-in-bool-context warnings'
    updated_at = <Date 2020-04-27.03:27:58.009>
    user = 'https://github.com/tiran'

    bugs.python.org fields:

    activity = <Date 2020-04-27.03:27:58.009>
    actor = 'zach.ware'
    assignee = 'christian.heimes'
    closed = True
    closed_date = <Date 2020-04-27.03:27:58.010>
    closer = 'zach.ware'
    components = ['Build']
    creation = <Date 2017-09-14.17:37:30.102>
    creator = 'christian.heimes'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 31474
    keywords = ['patch']
    message_count = 3.0
    messages = ['302188', '302286', '367367']
    nosy_count = 2.0
    nosy_names = ['christian.heimes', 'zach.ware']
    pr_nums = ['3581']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'compile error'
    url = 'https://bugs.python.org/issue31474'
    versions = ['Python 2.7']

    @tiran
    Copy link
    Member Author

    tiran commented Sep 14, 2017

    GCC 7.1 shows a bunch onf warnings related to -Wnonnull and -Wint-in-bool-context when compiling Python 2.7:

    In file included from Include/Python.h:78:0,
                     from Objects/listobject.c:3:
    Objects/listobject.c: In functionlist_resize’:
    Include/pymem.h:110:34: warning: ‘*in boolean context, suggest&&instead [-Wint-in-bool-context]
      (type *) PyMem_REALLOC((p), (n) * sizeof(type)) )
                                      ^
    Include/pymem.h:77:21: note: in definition of macroPyMem_REALLOC’
         : realloc((p), (n) ? (n) : 1))
                         ^
    Objects/listobject.c:62:9: note: in expansion of macroPyMem_RESIZEPyMem_RESIZE(items, PyObject *, new_allocated);
             ^~~~~~~~~~~~

    In file included from Python/formatter_string.c:17:0:
    Python/../Objects/stringlib/formatter.h: In function ‘format_float_internal’:
    Python/../Objects/stringlib/formatter.h:576:9: warning: argument 2 null where non-null expected [-Wnonnull]
    memmove(buf,
    ^~~~~~~~~~~~
    prefix,
    ~~~~~~~
    spec->n_prefix * sizeof(STRINGLIB_CHAR));
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    In file included from Include/Python.h:38:0,
    from Python/formatter_string.c:6:
    /usr/include/string.h:47:14: note: in a call to function ‘memmove’ declared here
    extern void *memmove (void *__dest, const void *__src, size_t __n)

    @tiran tiran self-assigned this Sep 14, 2017
    @tiran tiran added build The build process and cross-build labels Sep 14, 2017
    @tiran
    Copy link
    Member Author

    tiran commented Sep 15, 2017

    New changeset fd39e2a by Christian Heimes in branch '2.7':
    bpo-31474: Fix -Wint-in-bool-context warnings (bpo-3581)
    fd39e2a

    @zware
    Copy link
    Member

    zware commented Apr 27, 2020

    This seems to have been fixed but never closed? Closing it now anyway due to EOL :)

    @zware zware closed this as completed Apr 27, 2020
    @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
    build The build process and cross-build
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants