Movatterモバイル変換


[0]ホーム

URL:


homepage

Issue28768

This issue trackerhas been migrated toGitHub, and is currentlyread-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title:Warning: implicit declaration of function '_setmode'
Type:compile errorStage:commit review
Components:Build, WindowsVersions:Python 3.7, Python 3.6, Python 2.7
process
Status:closedResolution:fixed
Dependencies:Superseder:
Assigned To:Nosy List: benjamin.peterson, martin.panter, masamoto, paul.moore, python-dev, steve.dower, stutzbach, tim.golden, vstinner, zach.ware
Priority:normalKeywords:patch

Created on2016-11-21 20:00 bymasamoto, last changed2022-04-11 14:58 byadmin. This issue is nowclosed.

Files
File nameUploadedDescriptionEdit
include-io.h.patchmasamoto,2016-11-21 20:00review
2.7-include-io.h.patchmasamoto,2016-11-21 20:00review
Pull Requests
URLStatusLinkedEdit
PR 552closeddstufft,2017-03-31 16:36
Messages (9)
msg281389 -(view)Author: Masayuki Yamamoto (masamoto)*Date: 2016-11-21 20:00
Platform that appeared warning is Vista Cygwin x86. Interpreter execution doesn't crash because _setmode function is supplied from cygwin1.dll that always linked.Warning reason is header io.h [*] doesn't include to source file. Therefore I wrote two patches for 3.7 and 2.7.[*]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 -oModules/main.oModules/main.cModules/main.c: In function 'Py_Main':Modules/main.c:599:5: warning: implicit declaration of function '_setmode' [-Wimplicit-function-declaration]     _setmode(fileno(stdin), O_BINARY);     ^gcc -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  -I./Modules/_io -c ./Modules/_io/fileio.c -oModules/fileio.o./Modules/_io/fileio.c: In function '_io_FileIO___init___impl':./Modules/_io/fileio.c:478:5: warning: implicit declaration of function '_setmode' [-Wimplicit-function-declaration]     _setmode(self->fd, O_BINARY);     ^
msg281470 -(view)Author: Martin Panter (martin.panter)*(Python committer)Date: 2016-11-22 12:07
TheModules/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 viaPC/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__.
msg281472 -(view)Author: STINNER Victor (vstinner)*(Python committer)Date: 2016-11-22 12:14
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.
msg284210 -(view)Author: Roundup Robot (python-dev)(Python triager)Date: 2016-12-28 23:42
New changeset5027780d456b by Steve Dower in branch '3.6':Issue#28768: Fix implicit declaration of function _setmode. Patch by Masayuki Yamamotohttps://hg.python.org/cpython/rev/5027780d456bNew changeset276d1bae92be by Steve Dower in branch 'default':Issue#28768: Fix implicit declaration of function _setmode. Patch by Masayuki Yamamotohttps://hg.python.org/cpython/rev/276d1bae92be
msg284211 -(view)Author: Steve Dower (steve.dower)*(Python committer)Date: 2016-12-28 23:42
I applied to 3.6 and default. If anyone is motivated enough to apply to 2.7, feel free.
msg284566 -(view)Author: STINNER Victor (vstinner)*(Python committer)Date: 2017-01-03 14:12
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?
msg284616 -(view)Author: Masayuki Yamamoto (masamoto)*Date: 2017-01-04 06:47
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.
msg284645 -(view)Author: Roundup Robot (python-dev)(Python triager)Date: 2017-01-04 15:59
New changeset5ea0fef6ec53 by Steve Dower in branch '2.7':Issue#28768: Fix implicit declaration of function _setmode. Patch by Masayuki Yamamotohttps://hg.python.org/cpython/rev/5ea0fef6ec53
msg284646 -(view)Author: STINNER Victor (vstinner)*(Python committer)Date: 2017-01-04 16:00
Well, the change is not going to hurt. I backported the change. Thanks for the fix Masayuki!
History
DateUserActionArgs
2022-04-11 14:58:39adminsetgithub: 72954
2017-03-31 16:36:34dstufftsetpull_requests: +pull_request1071
2017-01-04 16:00:39vstinnersetstatus: open -> closed
resolution: fixed
messages: +msg284646
2017-01-04 15:59:56python-devsetmessages: +msg284645
2017-01-04 06:47:48masamotosetmessages: +msg284616
2017-01-03 14:12:46vstinnersetmessages: +msg284566
2016-12-28 23:42:29steve.dowersetmessages: +msg284211
stage: patch review -> commit review
2016-12-28 23:42:04python-devsetnosy: +python-dev
messages: +msg284210
2016-11-22 12:14:52vstinnersetnosy: +vstinner
messages: +msg281472
2016-11-22 12:07:09martin.pantersetnosy: +zach.ware,paul.moore,tim.golden,martin.panter,steve.dower
messages: +msg281470

components: + Windows
stage: patch review
2016-11-21 20:00:58masamotosetfiles: +2.7-include-io.h.patch
2016-11-21 20:00:30masamotocreate
Supported byThe Python Software Foundation,
Powered byRoundup
Copyright © 1990-2022,Python Software Foundation
Legal Statements

[8]ページ先頭

©2009-2026 Movatter.jp