This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: GCC 9 compiler warnings on MacOS Catalina
Type: behavior Stage: patch review
Components: Build, macOS Versions: Python 3.9
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: ned.deily, remi.lapeyre, ronaldoussoren
Priority: normal Keywords: patch

Created on 2020-05-05 13:32 by remi.lapeyre, last changed 2022-04-11 14:59 by admin.

Pull Requests
URL Status Linked Edit
PR 19925 open remi.lapeyre, 2020-05-05 13:35
Messages (2)
msg368146 - (view) Author: Rémi Lapeyre (remi.lapeyre) * Date: 2020-05-05 13:32
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.
msg368221 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2020-05-06 01:32
See proposed PR 19925 for further discussion.
History
Date User Action Args
2022-04-11 14:59:30adminsetgithub: 84696
2020-05-06 01:35:47ned.deilysetcomponents: + Build
2020-05-06 01:32:00ned.deilysetversions: + Python 3.9
nosy: + ronaldoussoren, ned.deily

messages: + msg368221

components: + macOS, - Build
2020-05-05 13:35:40remi.lapeyresetkeywords: + patch
stage: patch review
pull_requests: + pull_request19240
2020-05-05 13:32:24remi.lapeyrecreate