Skip to content

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
wants to merge 1 commit into from

Conversation

remilapeyre
Copy link
Contributor

@remilapeyre remilapeyre commented May 5, 2020

Copy link
Member

@corona10 corona10 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think that this is good way to fix it.

@remilapeyre
Copy link
Contributor Author

I don't think that this is good way to fix it.

I'm not sure what to do here. Is GCC 9 on Catalina supposed to be supported? I tried it because I'm having issues with debug symbols with the latest version of clang and GDB but should I just build gcc 10?

Copy link
Member

@corona10 corona10 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See the similar discussion about this issue.
#13306 (comment)

@bedevere-bot
Copy link

A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated.

Once you have made the requested changes, please leave a comment on this pull request containing the phrase I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

@ned-deily
Copy link
Member

My question is do we know if these are legitimate warnings? If so, does the current Apple-provided clang give them in an otherwise identical build environment and configure options? If not, why not :) ? Also does gcc 10 report the same errors? Do these errors show up in other BSD-based systems, like FreeBSD? BTW @remilapeyre. you mentioned problems using gdb with clang. Have you tried clang's native debugger, lldb?

@remilapeyre
Copy link
Contributor Author

Hi, thanks for your feedback, I had not found #13306 sorry about that.

For more context about this issue, I'm usually using clang and lldb but I'm currently trying to diagnose a segmentation fault during SSL handshakes. To understand what's going on I would like to use the gdb support (https://devguide.python.org/gdb/). Using gdb on a binary built with clang used to work well but broke recently, I opened an issue at https://sourceware.org/bugzilla/show_bug.cgi?id=25850.

I would actually be quite happy to continue using lldb as using gdb on MacOS is cumbersome since a certificate needs to be generated and gdb needs to signed with it but as as I know there is no way to get the same integration with the debugger.

My question is do we know if these are legitimate warnings? If so, does the current Apple-provided clang give them in an otherwise identical build environment and configure options? If not, why not :) ? Do these errors show up in other BSD-based systems, like FreeBSD?

The one in posix is specific to a quirk of MacOS 10.13, maybe clang knows about it? I did not check if the one in nis is present on BSD.

Also does gcc 10 report the same errors?

I did not try as I did not know it existed, it does not appear at https://gcc.gnu.org/releases.html.

My main goal here is to be able to use https://devguide.python.org/gdb/ on MacOS, I see multiple way to do that:

  • build with GCC 9 and the gdb support
  • build with GCC 10 and the gdb support
  • create the equivalent python-gdb.py for lldb so that I can avoid using GCC and GDB

Maybe the the third one is the best as a Python / LLDB could be useful to others?

@taleinat
Copy link
Contributor

Ping, @ned-deily, @corona10?

@ned-deily
Copy link
Member

Ping, @ned-deily, @corona10?

I don't have further suggestions as it's not really my area of expertise. Perhaps @ronaldoussoren might.

@remilapeyre
Copy link
Contributor Author

For what it's worth I started working on a python-lldb.py script that would make it possible to use the same commands available in GDB. I don't have experience with the Python bindings of LLDB so it's taking me quite some time but I already have some commands working.

Copy link
Contributor

@ronaldoussoren ronaldoussoren left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are the nismodule.c warnings also present on Linux systems with GCC 9? If so, adding warning suppression seems like a sane thing to do.

@@ -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"
Copy link
Contributor

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.

cb.foreach = (foreachfunc)nis_foreach;
#pragma GCC diagnostic pop
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Likewise

@@ -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.
Copy link
Contributor

Choose a reason for hiding this comment

The 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).

@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.

@AlexWaygood
Copy link
Member

This PR has been "awaiting changes" for over a year, and now has a merge conflict. I am therefore closing this PR.

@remilapeyre, if you're still interested in working on this issue, feel free to ping me and I'll happily reopen the PR. However, do note that the nis module is now deprecated, as @hugovk says, so it will probably be low priority for the core dev team to review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants