msg201485 - (view) |
Author: Tim Golden (tim.golden) *  |
Date: 2013-10-27 19:44 |
Modules/audioop.c is giving compile warnings on Windows against lines 18 & 437. ..\Modules\audioop.c(18): warning C4146: unary minus operator applied to unsigned type, result still unsigned ..\Modules\audioop.c(437): warning C4146: unary minus operator applied to unsigned type, result still unsigned |
|
|
msg201486 - (view) |
Author: Tim Golden (tim.golden) *  |
Date: 2013-10-27 19:46 |
The attached patch appears to fix the problem. |
|
|
msg201490 - (view) |
Author: Serhiy Storchaka (serhiy.storchaka) *  |
Date: 2013-10-27 20:16 |
But it adds warnings on 32-bit platform with GCC. /home/serhiy/py/cpython/Modules/audioop.c🔞61: warning: integer overflow in expression [-Woverflow] /home/serhiy/py/cpython/Modules/audioop.c: In function ‘audioop_minmax’: /home/serhiy/py/cpython/Modules/audioop.c:437:33: warning: integer overflow in expression [-Woverflow] |
|
|
msg201491 - (view) |
Author: Serhiy Storchaka (serhiy.storchaka) *  |
Date: 2013-10-27 20:19 |
What if use (int)-0x80000000 instead of -(int)0x80000000? Does it silence warnings on Windows? |
|
|
msg201492 - (view) |
Author: Tim Golden (tim.golden) *  |
Date: 2013-10-27 20:20 |
I don't think it will, given MS description of the compiler warning: http://msdn.microsoft.com/en-us/library/4kh09110%28v=vs.100%29.aspx but I'll certainly give it a go. |
|
|
msg201495 - (view) |
Author: Tim Peters (tim.peters) *  |
Date: 2013-10-27 20:42 |
Use -0x7FFFFFFF-1 Nobody should complain about that, because it's standard C ;-) On Sun, Oct 27, 2013 at 3:20 PM, Tim Golden <report@bugs.python.org> wrote: > > Tim Golden added the comment: > > I don't think it will, given MS description of the compiler warning: > > http://msdn.microsoft.com/en-us/library/4kh09110%28v=vs.100%29.aspx > > but I'll certainly give it a go. > > ---------- > > _______________________________________ > Python tracker <report@bugs.python.org> > <http://bugs.python.org/issue19418> > _______________________________________ > _______________________________________________ > Python-bugs-list mailing list > Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/tim.peters%40gmail.com > |
|
|
msg201496 - (view) |
Author: Serhiy Storchaka (serhiy.storchaka) *  |
Date: 2013-10-27 20:46 |
LGTM. Do you want commit a patch? |
|
|
msg201499 - (view) |
Author: Tim Peters (tim.peters) *  |
Date: 2013-10-27 20:58 |
@Serhiy, nope, pressed for time today :-( |
|
|
msg201501 - (view) |
Author: Tim Golden (tim.golden) *  |
Date: 2013-10-27 21:05 |
Good idea. I'll test against Win32/64 & Linux 32 |
|
|
msg201575 - (view) |
Author: Tim Golden (tim.golden) *  |
Date: 2013-10-28 20:31 |
The attached patch (using Tim Peters' -1 trick) builds & tests ok on Win32/64 & Linux 32. |
|
|
msg201576 - (view) |
Author: STINNER Victor (vstinner) *  |
Date: 2013-10-28 20:37 |
You should add a comment to explain why the trick is required (because of compilers not supporting -0x80000000 literal without a warning). |
|
|
msg201579 - (view) |
Author: Tim Golden (tim.golden) *  |
Date: 2013-10-28 20:49 |
Good point. Updated patch. |
|
|
msg201584 - (view) |
Author: Serhiy Storchaka (serhiy.storchaka) *  |
Date: 2013-10-28 21:21 |
LGTM. |
|
|
msg201798 - (view) |
Author: Roundup Robot (python-dev)  |
Date: 2013-10-31 10:52 |
New changeset 0848c90a5dd1 by Tim Golden in branch 'default': Issue #19418 Fix some warnings on Win64 http://hg.python.org/cpython/rev/0848c90a5dd1 |
|
|
msg201833 - (view) |
Author: Roundup Robot (python-dev)  |
Date: 2013-10-31 17:40 |
New changeset 54bf7b5ec3b6 by Tim Golden in branch '3.3': Issue #19418 Fix some warnings on Win64 http://hg.python.org/cpython/rev/54bf7b5ec3b6 |
|
|
msg201835 - (view) |
Author: Tim Golden (tim.golden) *  |
Date: 2013-10-31 17:51 |
Fixed in 3.3 / 3.4 |
|
|
msg318836 - (view) |
Author: STINNER Victor (vstinner) *  |
Date: 2018-06-06 15:51 |
New changeset e5b79c546370521764457ea2ec809303e580f5ea by Victor Stinner in branch '2.7': bpo-19418: audioop.c: Fix warnings on -0x80000000 (GH-7453) https://github.com/python/cpython/commit/e5b79c546370521764457ea2ec809303e580f5ea |
|
|