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 9 compiler warnings on MacOS Catalina #84696

Closed
remilapeyre mannequin opened this issue May 5, 2020 · 5 comments
Closed

GCC 9 compiler warnings on MacOS Catalina #84696

remilapeyre mannequin opened this issue May 5, 2020 · 5 comments
Labels
3.9 only security fixes build The build process and cross-build OS-mac type-bug An unexpected behavior, bug, or error

Comments

@remilapeyre
Copy link
Mannequin

remilapeyre mannequin commented May 5, 2020

BPO 40516
Nosy @ronaldoussoren, @ned-deily, @remilapeyre
PRs
  • bpo-40516: Silence GCC 9 warnings on MacOS Catalina #19925
  • 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 = None
    created_at = <Date 2020-05-05.13:32:24.115>
    labels = ['OS-mac', 'type-bug', '3.9', 'build']
    title = 'GCC 9 compiler warnings on MacOS Catalina'
    updated_at = <Date 2020-05-06.01:35:47.989>
    user = 'https://github.com/remilapeyre'

    bugs.python.org fields:

    activity = <Date 2020-05-06.01:35:47.989>
    actor = 'ned.deily'
    assignee = 'none'
    closed = False
    closed_date = None
    closer = None
    components = ['Build', 'macOS']
    creation = <Date 2020-05-05.13:32:24.115>
    creator = 'remi.lapeyre'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 40516
    keywords = ['patch']
    message_count = 2.0
    messages = ['368146', '368221']
    nosy_count = 3.0
    nosy_names = ['ronaldoussoren', 'ned.deily', 'remi.lapeyre']
    pr_nums = ['19925']
    priority = 'normal'
    resolution = None
    stage = 'patch review'
    status = 'open'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue40516'
    versions = ['Python 3.9']

    @remilapeyre
    Copy link
    Mannequin Author

    remilapeyre mannequin commented May 5, 2020

    Building master with GCC 9.3.0 gives some warnings on posix and nis:

    ./Modules/posixmodule.c: In function 'os_chown_impl':
    ./Modules/posixmodule.c:3397:39: warning: the comparison will always evaluate as 'false' for the address of 'lchown' will never be NULL [-Waddress]
    3397 | if ((!follow_symlinks) && (lchown == NULL)) {
    | ^~
    ./Modules/posixmodule.c: In function 'PyInit_posix':
    ./Modules/posixmodule.c:14939:16: warning: the comparison will always evaluate as 'false' for the address of 'lchown' will never be NULL [-Waddress]
    14939 | if (lchown == NULL) {
    | ^~
    /Users/remi/src/cpython/Modules/nismodule.c: In function 'nis_cat':
    /Users/remi/src/cpython/Modules/nismodule.c:216:18: warning: cast between incompatible function types from 'int ()(int, char *, int, char *, int, struct ypcallback_data *)' to 'int ()(long unsigned int, char *, int, char *, int, void *)' [-Wcast-function-type]
    216 | cb.foreach = (foreachfunc)nis_foreach;
    | ^
    /Users/remi/src/cpython/Modules/nismodule.c: In function 'nis_xdr_ypmaplist':
    /Users/remi/src/cpython/Modules/nismodule.c:302:42: warning: cast between incompatible function types from 'int ()(XDR *, nismaplist *)' {aka 'int ()(struct __rpc_xdr *, struct nismaplist *)'} to 'int ()(XDR *, void *, unsigned int)' {aka 'int ()(struct __rpc_xdr *, void *, unsigned int)'} [-Wcast-function-type]
    302 | sizeof(nismaplist), (xdrproc_t)nis_xdr_ypmaplist))
    | ^
    /Users/remi/src/cpython/Modules/nismodule.c: In function 'nis_xdr_ypresp_maplist':
    /Users/remi/src/cpython/Modules/nismodule.c:328:42: warning: cast between incompatible function types from 'int ()(XDR *, nismaplist *)' {aka 'int ()(struct __rpc_xdr *, struct nismaplist *)'} to 'int ()(XDR *, void *, unsigned int)' {aka 'int ()(struct __rpc_xdr *, void *, unsigned int)'} [-Wcast-function-type]
    328 | sizeof(nismaplist), (xdrproc_t)nis_xdr_ypmaplist))
    | ^
    In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/rpc/rpc.h:76,
    from /Users/remi/src/cpython/Modules/nismodule.c:17:
    /Users/remi/src/cpython/Modules/nismodule.c: In function 'nisproc_maplist_2':
    /Users/remi/src/cpython/Modules/nismodule.c:344:19: warning: cast between incompatible function types from 'int ()(XDR *, char **)' {aka 'int ()(struct __rpc_xdr *, char **)'} to 'int ()(XDR *, void *, unsigned int)' {aka 'int ()(struct __rpc_xdr *, void *, unsigned int)'} [-Wcast-function-type]
    344 | (xdrproc_t)nis_xdr_domainname, (caddr_t)argp,
    | ^
    /Users/remi/src/cpython/Modules/nismodule.c:345:19: warning: cast between incompatible function types from 'int ()(XDR *, nisresp_maplist *)' {aka 'int ()(struct __rpc_xdr *, struct nisresp_maplist *)'} to 'int ()(XDR *, void *, unsigned int)' {aka 'int ()(struct __rpc_xdr *, void *, unsigned int)'} [-Wcast-function-type]
    345 | (xdrproc_t)nis_xdr_ypresp_maplist, (caddr_t)&res,
    | ^

    I'm not sure about the fix, especially for nis but I will propose a PR. There is also some warnings concerning libffi_osx but this looks like a vendored dependency so I left it untouched.

    @remilapeyre remilapeyre mannequin added build The build process and cross-build type-bug An unexpected behavior, bug, or error labels May 5, 2020
    @ned-deily
    Copy link
    Member

    See proposed PR 19925 for further discussion.

    @ned-deily ned-deily added OS-mac 3.9 only security fixes build The build process and cross-build and removed build The build process and cross-build labels May 6, 2020
    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    @hugovk
    Copy link
    Member

    hugovk commented Apr 11, 2022

    Note the nis module is deprecated in 3.11 and set for removal in 3.13.

    See PEP 594 – Removing dead batteries from the standard library and #91217.

    @erlend-aasland
    Copy link
    Contributor

    I believe the warnings in posixmodule.c was fixed in gh-22855 (see #19925 (comment))

    Since the remaining warnings belong to the nis module, I suggest to close this issue.

    @erlend-aasland erlend-aasland added the pending The issue will be closed if no feedback is provided label May 19, 2022
    @AA-Turner
    Copy link
    Member

    Closing per Erlend, it's been several days with no comments to the contrary.

    A

    @AA-Turner AA-Turner closed this as not planned Won't fix, can't repro, duplicate, stale May 28, 2022
    @AlexWaygood AlexWaygood removed the pending The issue will be closed if no feedback is provided label May 28, 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 build The build process and cross-build OS-mac type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    5 participants