-
-
Notifications
You must be signed in to change notification settings - Fork 31.7k
Warning: implicit declaration of function '_setmode' #72954
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
Comments
Platform that appeared warning is Vista Cygwin x86. Interpreter execution doesn't crash because _setmode function is supplied from cygwin1.dll that always linked. [*] https://msdn.microsoft.com/en-us/library/tw4k6df8.aspx (Cygwin also avaliable) build log on 3.7: gcc -c -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -I. -I./Include -DPy_BUILD_CORE -o Modules/main.o Modules/main.c |
The Modules/main.c change at least looks reasonable as a bug fix. In the long term, it would be nice to clean up some of the conditions for including <io.h>. Currently it is unconditional via PC/pyconfig.h, configure.ac optionally enables HAVE_IO_H, and there are various other conditions in different files, like as QUICKWIN, PYCC_VACPP and MS_WINDOWS || __CYGWIN__. |
include-io.h.patch LGTM. 2.7-include-io.h.patch: Cygwin is not currently officially supported in CPython. I suggest to focus efforts on supporting Cygwin in the default branch (future 3.7) only, as we are doing with Android. |
New changeset 5027780d456b by Steve Dower in branch '3.6': New changeset 276d1bae92be by Steve Dower in branch 'default': |
I applied to 3.6 and default. If anyone is motivated enough to apply to 2.7, feel free. |
Masayuki Yamamoto: Do you consider that Python 2.7 should be fixed as well? What is your use case for compiling Python 2.7 on Windows using Cygwin? |
Building 2.7 is for testing purposes. It is used to judge whether it is a problem (specifically for Cygwin-specific) originated in the old version. _setmode is an important function for setting input and output of CPython, so in Cygwin I feel annoying that warnings are issued even though there is actually no problem. |
New changeset 5ea0fef6ec53 by Steve Dower in branch '2.7': |
Well, the change is not going to hurt. I backported the change. Thanks for the fix Masayuki! |
Misc/NEWS
so that it is managed by towncrier #552Note: 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:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: