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

Created on 2009-04-14 17:22 by zooko, last changed 2018-05-15 21:37 by eitan.adler.

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 open jdemeyer, 2018-05-14 10:29
Messages (7)
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:

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: (and here
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.
Date User Action Args
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