-
-
Notifications
You must be signed in to change notification settings - Fork 32.2k
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
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
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); | ||
} | ||
|
||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. | ||
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 */ | ||
|
||
|
||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.