classification
Title: "-Wstrict-prototypes" is valid for Ada/C/ObjC but not for C++"
Type: Stage: resolved
Components: Distutils Versions:
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: tarek Nosy List: GooseYArd, Jason.Grout, eitan.adler, inada.naoki, jdemeyer, miss-islington, serhiy.storchaka, tarek, vokoda, zooko
Priority: normal Keywords: patch

Created on 2009-04-14 17:22 by zooko, last changed 2018-06-07 10:13 by jdemeyer. This issue is now closed.

Files
File name Uploaded Description Edit
no_strict_proto.patch jdemeyer, 2016-09-08 11:45 Disable -Wstrict-prototypes
Pull Requests
URL Status Linked Edit
PR 6791 closed jdemeyer, 2018-05-14 10:29
PR 7395 merged inada.naoki, 2018-06-04 12:35
PR 7422 merged miss-islington, 2018-06-05 11:42
PR 7438 merged inada.naoki, 2018-06-06 00:18
PR 7476 open jdemeyer, 2018-06-07 10:13
Messages (16)
msg85972 - (view) Author: Zooko O'Whielacronx (zooko) Date: 2009-04-14 17:22
A user of the Tahoe-LAFS project submitted a bug report to us, saying:

"""
I get lots of "cc1plus: warning: command line option "-Wstrict-
prototypes" is valid for Ada/C/ObjC but not for C++" when compiling
"""

A little googling shows that this gets reported frequently to other 
Python projects that have C++ code:

http://trac.sagemath.org/sage_trac/ticket/425
http://www.mail-archive.com/matplotlib-
users@lists.sourceforge.net/msg03947.html

Those other projects seem to think that this is distutils's problem, but 
I don't see evidence that any of them opened a ticket for distutils yet.
msg87130 - (view) Author: Tarek Ziadé (tarek) * (Python committer) Date: 2009-05-04 14:14
I could work on a patch for this, by checking the compiler, if I get
some feedback from the matplotlib guys in this issue here
msg116598 - (view) Author: Jason Grout (Jason.Grout) Date: 2010-09-16 19:34
Any progress on this?  I see this warning a *lot* when compiling lots of packages for Sage (matplotlib included).
msg135128 - (view) Author: Peter Le Bek (vokoda) Date: 2011-05-04 13:04
distutils reuses whatever flags Python was built with, covered here: http://bugs.python.org/issue1222585 (and here http://bugs.python.org/issue9031).
msg316519 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2018-05-14 15:18
Maybe include it in PY_CFLAGS_NODIST instead of PY_CFLAGS? Or just remove it, since in any case we now use -Wall and -Wextra with GCC.
msg316626 - (view) Author: Jeroen Demeyer (jdemeyer) * Date: 2018-05-15 06:27
> Or just remove it

I updated the PR to do that.

I didn't want to propose that initially because that patch was proposed here almost 2 years ago but not accepted.
msg316733 - (view) Author: Eitan Adler (eitan.adler) * Date: 2018-05-15 21:37
copying and adapting my comments on the PR:

Strict Prototypes is correct and helpful for C. That said, the way it is currently implemented, by checking for the compiler in CC is sub-optimal at best.
CC ought to always be a C compiler, and never a C++ compiler.
It also seems questionable that distutils is using the python cflags rather than a dedicated set.

The best fix is a separate and specific list of flags for distutils rather than modifying the set of flags used to build python. That said, the current implementing of flags for python isn't great, so lets remove it as a short term fix.
msg318644 - (view) Author: INADA Naoki (inada.naoki) * (Python committer) Date: 2018-06-04 11:17
Can we backport this to 3.7 and 3.6?  I think it's safe and helpful.
msg318645 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2018-06-04 11:53
I am not sure now about removing -Wstrict-prototypes. I haven't found confirmation that this option is included in -Wall or -Wextra.
msg318647 - (view) Author: INADA Naoki (inada.naoki) * (Python committer) Date: 2018-06-04 12:38
-Wstrict-prototypes is not included in -Wall and -Wextra.
I created PR-7395 which moves the option to CFLAGS_NODIST, as Serhiy suggested before.
msg318648 - (view) Author: Jeroen Demeyer (jdemeyer) * Date: 2018-06-04 12:48
> Can we backport this to 3.7 and 3.6?  I think it's safe and helpful.

And 2.7 for the same reasons.
msg318650 - (view) Author: INADA Naoki (inada.naoki) * (Python committer) Date: 2018-06-04 13:02
2.7 doesn't have CFLAGS_NODIST and I don't have motivation to manually backport it to 2.7.  (I'm not expert of autotools)
msg318651 - (view) Author: Jeroen Demeyer (jdemeyer) * Date: 2018-06-04 13:18
> 2.7 doesn't have CFLAGS_NODIST

I meant backporting this patch as-is to 2.7 without adding -Wstrict-prototypes to CFLAGS_NODIST
msg318737 - (view) Author: INADA Naoki (inada.naoki) * (Python committer) Date: 2018-06-05 11:40
New changeset e33648484775fa533fc8f1e5cc45f60061d29d54 by INADA Naoki in branch 'master':
bpo-5755: Move -Wstrict-prototypes to CFLAGS_NODIST (GH-7395)
https://github.com/python/cpython/commit/e33648484775fa533fc8f1e5cc45f60061d29d54
msg318792 - (view) Author: miss-islington (miss-islington) Date: 2018-06-06 00:12
New changeset d6e789c402330905b1bd9103538d1027fcfb08a4 by Miss Islington (bot) in branch '3.7':
bpo-5755: Move -Wstrict-prototypes to CFLAGS_NODIST (GH-7395)
https://github.com/python/cpython/commit/d6e789c402330905b1bd9103538d1027fcfb08a4
msg318800 - (view) Author: INADA Naoki (inada.naoki) * (Python committer) Date: 2018-06-06 05:18
New changeset d59f97c8325ba509c9b08d488091f45ca642f0b6 by INADA Naoki in branch '3.6':
bpo-5755: Move -Wstrict-prototypes to CFLAGS_NODIST (GH-7395)
https://github.com/python/cpython/commit/d59f97c8325ba509c9b08d488091f45ca642f0b6
History
Date User Action Args
2018-06-07 10:13:19jdemeyersetpull_requests: + pull_request7099
2018-06-06 05:26:45inada.naokisetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2018-06-06 05:18:19inada.naokisetmessages: + msg318800
2018-06-06 00:18:58inada.naokisetpull_requests: + pull_request7065
2018-06-06 00:12:09miss-islingtonsetnosy: + miss-islington
messages: + msg318792
2018-06-05 11:42:12miss-islingtonsetpull_requests: + pull_request7047
2018-06-05 11:40:56inada.naokisetmessages: + msg318737
2018-06-04 13:18:27jdemeyersetmessages: + msg318651
2018-06-04 13:02:48inada.naokisetmessages: + msg318650
2018-06-04 12:48:46jdemeyersetmessages: + msg318648
2018-06-04 12:38:01inada.naokisetmessages: + msg318647
2018-06-04 12:35:33inada.naokisetpull_requests: + pull_request7021
2018-06-04 11:53:31serhiy.storchakasetmessages: + msg318645
2018-06-04 11:17:50inada.naokisetnosy: + inada.naoki
messages: + msg318644
2018-05-15 21:37:15eitan.adlersetmessages: + msg316733
2018-05-15 21:30:41eitan.adlersetnosy: + eitan.adler
2018-05-15 06:27:06jdemeyersetmessages: + msg316626
2018-05-14 15:18:59serhiy.storchakasetnosy: + serhiy.storchaka
messages: + msg316519
2018-05-14 10:29:17jdemeyersetstage: patch review
pull_requests: + pull_request6476
2018-05-14 08:12:14jdemeyersetnosy: + jdemeyer
2016-09-08 11:45:58jdemeyersetfiles: + no_strict_proto.patch
keywords: + patch
2014-01-25 19:02:13jonsetnosy: - jon
2011-05-04 13:04:14vokodasetnosy: + vokoda
messages: + msg135128
2011-04-08 22:05:46jonsetnosy: + jon
2010-12-24 02:41:59GooseYArdsetnosy: + GooseYArd
2010-09-16 19:34:52Jason.Groutsetnosy: + Jason.Grout
messages: + msg116598
2009-05-04 14:14:39tareksetmessages: + msg87130
2009-04-14 17:22:50zookocreate