Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 34k
bpo-40516: Silence GCC 9 warnings on MacOS Catalina#19925
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
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -213,7 +213,9 @@ nis_cat (PyObject *self, PyObject *args, PyObject *kwdict) | ||
| dict = PyDict_New (); | ||
| if (dict == NULL) | ||
| return NULL; | ||
| #pragma GCC diagnostic ignored "-Wcast-function-type" | ||
| cb.foreach = (foreachfunc)nis_foreach; | ||
| #pragma GCC diagnostic pop | ||
Contributor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Likewise | ||
| data.dict = dict; | ||
| map = nis_mapname (map, &data.fix); | ||
| cb.data = (char *)&data; | ||
| @@ -298,11 +300,12 @@ nis_xdr_ypmaplist(XDR *xdrs, nismaplist *objp) | ||
| if (!nis_xdr_mapname(xdrs, &objp->map)){ | ||
| return (FALSE); | ||
| } | ||
| #pragma GCC diagnostic ignored "-Wcast-function-type" | ||
| if (!xdr_pointer(xdrs, (char **)&objp->next, | ||
| sizeof(nismaplist), (xdrproc_t)nis_xdr_ypmaplist)) | ||
| { | ||
| sizeof(nismaplist), (xdrproc_t)nis_xdr_ypmaplist)){ | ||
| return (FALSE); | ||
| } | ||
| #pragma GCC diagnostic pop | ||
| return (TRUE); | ||
| } | ||
| @@ -324,11 +327,12 @@ nis_xdr_ypresp_maplist(XDR *xdrs, nisresp_maplist *objp) | ||
| if (!nis_xdr_ypstat(xdrs, &objp->stat)){ | ||
| return (FALSE); | ||
| } | ||
| #pragma GCC diagnostic ignored "-Wcast-function-type" | ||
| if (!xdr_pointer(xdrs, (char **)&objp->maps, | ||
| sizeof(nismaplist), (xdrproc_t)nis_xdr_ypmaplist)) | ||
| { | ||
| sizeof(nismaplist), (xdrproc_t)nis_xdr_ypmaplist)){ | ||
| return (FALSE); | ||
| } | ||
| #pragma GCC diagnostic pop | ||
| return (TRUE); | ||
| } | ||
| @@ -340,13 +344,14 @@ nisproc_maplist_2(domainname *argp, CLIENT *clnt) | ||
| static nisresp_maplist res; | ||
| memset(&res, 0, sizeof(res)); | ||
| #pragma GCC diagnostic ignored "-Wcast-function-type" | ||
| if (clnt_call(clnt, YPPROC_MAPLIST, | ||
| (xdrproc_t)nis_xdr_domainname, (caddr_t)argp, | ||
| (xdrproc_t)nis_xdr_ypresp_maplist, (caddr_t)&res, | ||
| TIMEOUT) != RPC_SUCCESS) | ||
| { | ||
| TIMEOUT) != RPC_SUCCESS){ | ||
| return (NULL); | ||
| } | ||
| #pragma GCC diagnostic pop | ||
| return (&res); | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -3392,12 +3392,15 @@ os_chown_impl(PyObject *module, path_t *path, uid_t uid, gid_t gid, | ||
| * This is for Mac OS X 10.3, which doesn't have lchown. | ||
Contributor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. PR #22855 will fix the warnings in posixmodule.c (as a side effect of more interesting changes). | ||
| * (But we still have an lchown symbol because of weak-linking.) | ||
| * It doesn't have fchownat either. So there's no possibility | ||
| * of a graceful failover. | ||
| * of a graceful failover. GCC 9 complains about this so we silence his | ||
| * warning. | ||
| */ | ||
| #pragma GCC diagnostic ignored "-Waddress" | ||
| if ((!follow_symlinks) && (lchown == NULL)){ | ||
| follow_symlinks_specified("chown", follow_symlinks); | ||
| return NULL; | ||
| } | ||
| #pragma GCC diagnostic pop | ||
| #endif | ||
| if (PySys_Audit("os.chown", "OIIi", path->object, uid, gid, | ||
| @@ -14936,11 +14939,14 @@ INITFUNC(void) | ||
| #endif /* HAVE_STATVFS */ | ||
| # ifdef HAVE_LCHOWN | ||
| /* GCC 9 complains about lchown always being defined so silence it here. */ | ||
| #pragma GCC diagnostic ignored "-Waddress" | ||
| if (lchown == NULL){ | ||
| if (PyObject_DelAttrString(m, "lchown") == -1){ | ||
| return NULL; | ||
| } | ||
| } | ||
| #pragma GCC diagnostic pop | ||
| #endif /* HAVE_LCHOWN */ | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs a preprocessor guard to ensure the pragma is only used with compatible compilers.