You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The patch attached enables -Wsign-compare and -Wunreachable-code if supported by the compiler.
AFAICT, mixed sign comparison warning is automatically enabled by Microsoft's compiler, and is usually a good thing.
It does add some warnings though.
As for unreachable code, it's also usually a good thing, since it can be a source of bugs. Note that it's not enabled in debug mode, since in debug mode the code paths aren't the same.
GCC >=4.5.0 (released on 2010-04-14) silently accepts and ignores -Wunreachable-code option. I think that build system of Python should not pass unused options to compiler.
Activity
neologix commentedon Jul 30, 2014
The patch attached enables -Wsign-compare and -Wunreachable-code if supported by the compiler.
AFAICT, mixed sign comparison warning is automatically enabled by Microsoft's compiler, and is usually a good thing.
It does add some warnings though.
As for unreachable code, it's also usually a good thing, since it can be a source of bugs. Note that it's not enabled in debug mode, since in debug mode the code paths aren't the same.
pitrou commentedon Jul 30, 2014
+1 from me.
vstinner commentedon Jul 30, 2014
The patch adds a a lot of new warnings. Would it be possible to fix them before applying the patch?
pitrou commentedon Jul 31, 2014
Enabling the warnings may be a good incitation for other people to fix them ;)
neologix commentedon Jul 31, 2014
That was my intention...
Can I push it, and let warnings be fixed on a case-by-case basis?
pitrou commentedon Jul 31, 2014
Le 31/07/2014 13:51, Charles-François Natali a écrit :
+1 from me.
python-dev commentedon Aug 1, 2014
New changeset 2c70897e5f98 by Charles-François Natali in branch 'default':
Issue bpo-22110: Enable extra compilation warnings.
http://hg.python.org/cpython/rev/2c70897e5f98
neologix commentedon Aug 1, 2014
Committed.
Sorry for the extra ~70 warnings :-)
Arfrever commentedon Aug 3, 2014
GCC >=4.5.0 (released on 2010-04-14) silently accepts and ignores -Wunreachable-code option. I think that build system of Python should not pass unused options to compiler.
ned-deily commentedon Mar 8, 2016
See Issue bpo-24324 which modifies configure to not use -Wunreachable-code with gcc for the reasons stated there and by Arfrever above.