[issue9566] Compilation warnings under x64 Windows

2019-04-23 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 8a9a6b443c57e47e9d10ed7775479aada4dac719 by Victor Stinner in 
branch '3.7':
[3.7] bpo-9566: Fix compiler warnings on Windows (GH-12920)
https://github.com/python/cpython/commit/8a9a6b443c57e47e9d10ed7775479aada4dac719


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9566] Compilation warnings under x64 Windows

2019-04-23 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +12846

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9566] Compilation warnings under x64 Windows

2019-03-06 Thread STINNER Victor


STINNER Victor  added the comment:

> New changeset edad38e3e05586ba58291f47756eb3fb808f5577 by Victor Stinner 
> (Jeremy Kloth) in branch 'master':
> bpo-9566: Fix compiler warnings in gcmodule.c (GH-11010)

It fixed the last known warning. Thanks everyone who was involved in this funny 
ride. It's now time to close the issue!

It just took 9 years to fix all compiler warnings on 64-bit Windows ;-)

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9566] Compilation warnings under x64 Windows

2019-03-06 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset edad38e3e05586ba58291f47756eb3fb808f5577 by Victor Stinner 
(Jeremy Kloth) in branch 'master':
bpo-9566: Fix compiler warnings in gcmodule.c (GH-11010)
https://github.com/python/cpython/commit/edad38e3e05586ba58291f47756eb3fb808f5577


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9566] Compilation warnings under x64 Windows

2018-12-07 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 028f0ef4f3111d2b3fc5b971642e337ba7990873 by Victor Stinner in 
branch 'master':
bpo-9566: Fix compiler warnings in peephole.c (GH-10652)
https://github.com/python/cpython/commit/028f0ef4f3111d2b3fc5b971642e337ba7990873


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9566] Compilation warnings under x64 Windows

2018-12-06 Thread Jeremy Kloth


Jeremy Kloth  added the comment:

I've added two PRs (GH-11010 and GH-11011) along with bpo-35433 that should get 
3.x warning free (finally!) on 64-bit Windows.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9566] Compilation warnings under x64 Windows

2018-12-06 Thread Jeremy Kloth


Change by Jeremy Kloth :


--
nosy: +jkloth

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9566] Compilation warnings under x64 Windows

2018-12-06 Thread Jeremy Kloth


Change by Jeremy Kloth :


--
pull_requests: +10245

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9566] Compilation warnings under x64 Windows

2018-12-06 Thread Jeremy Kloth


Change by Jeremy Kloth :


--
pull_requests: +10244

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9566] Compilation warnings under x64 Windows

2018-11-22 Thread STINNER Victor


STINNER Victor  added the comment:

There is also:

commit cdbcb773f5db24e23fa90e644ec620d54bd08127
Author: Victor Stinner 
Date:   Thu Nov 22 10:25:46 2018 +0100

cjkcodecs: Fix compiler warning (GH-10651)

Fixed the following compiler warning in multibytecodec.c:

warning C4244: '=': conversion from 'Py_ssize_t'
to 'unsigned char', possible loss of data

Cast Py_ssize_t to unsigned char: the maximum value is checked
on the previous line.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9566] Compilation warnings under x64 Windows

2018-11-22 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 28f468cb19e3097079b7ce7850e6048de99022fa by Victor Stinner in 
branch 'master':
bpo-9566: Fix compiler warnings in pyexpat.c (GH-10654)
https://github.com/python/cpython/commit/28f468cb19e3097079b7ce7850e6048de99022fa


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9566] Compilation warnings under x64 Windows

2018-11-22 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +9907

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9566] Compilation warnings under x64 Windows

2018-11-22 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +9905

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9566] Compilation warnings under x64 Windows

2018-01-18 Thread STINNER Victor

STINNER Victor  added the comment:


New changeset 05d68a8bd84cb141be9f9335f5b3540f15a989c4 by Victor Stinner in 
branch 'master':
bpo-9566: Fix size_t=>int downcast warnings (#5230)
https://github.com/python/cpython/commit/05d68a8bd84cb141be9f9335f5b3540f15a989c4


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9566] Compilation warnings under x64 Windows

2018-01-18 Thread STINNER Victor

Change by STINNER Victor :


--
pull_requests: +5077

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9566] Compilation warnings under x64 Windows

2017-08-20 Thread Antoine Pitrou

Antoine Pitrou added the comment:


New changeset 0267128aa4dc7c383c341c19833c5d506eae9c93 by Antoine Pitrou (Segev 
Finer) in branch 'master':
bpo-9566 & bpo-30747: Silence warnings from pyatomic.h macros (#3140)
https://github.com/python/cpython/commit/0267128aa4dc7c383c341c19833c5d506eae9c93


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9566] Compilation warnings under x64 Windows

2017-08-18 Thread Segev Finer

Changes by Segev Finer :


--
pull_requests: +3174

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9566] Compilation warnings under x64 Windows

2017-07-27 Thread Segev Finer

Segev Finer added the comment:

The only warnings that remain are:

1. The one from gcmodule.c due to dtrace, which is handled in PR 2852.
2. The peephole warnings which I'm not sure about. Are overflows possible there 
or not? That is, if there are already internal caps that prevent them. If they 
are possible, it might require a larger change to support EXTENDED_ARG in some 
places. i.e. can the consts table really grow larger than `unsigned int` or can 
a jump target be large enough to overflow?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9566] Compilation warnings under x64 Windows

2017-07-26 Thread Steve Dower

Steve Dower added the comment:


New changeset a80e985c493d2ab9df0832c99d9ddb798d2e66cf by Steve Dower (Segev 
Finer) in branch 'master':
bpo-9566: Change HANDLE argument parsing to unsigned in msvcrtmodule.c (#2904)
https://github.com/python/cpython/commit/a80e985c493d2ab9df0832c99d9ddb798d2e66cf


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9566] Compilation warnings under x64 Windows

2017-07-26 Thread Segev Finer

Segev Finer added the comment:

@haypo https://github.com/python/cpython/pull/2904

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9566] Compilation warnings under x64 Windows

2017-07-26 Thread STINNER Victor

STINNER Victor added the comment:

Two other broken buildbots:
http://buildbot.python.org/all/builders/AMD64%20Windows8%203.x/builds/967/steps/test/logs/stdio
http://buildbot.python.org/all/builders/AMD64%20Windows10%203.x/builds/997/steps/test/logs/stdio

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9566] Compilation warnings under x64 Windows

2017-07-26 Thread STINNER Victor

STINNER Victor added the comment:

> New changeset 679b566622ec811c5e5d580f6a538f7a43006e05 by Steve Dower (Segev 
> Finer) in branch 'master':
> bpo-9566: Fix some Windows x64 compiler warnings (#2492)
> https://github.com/python/cpython/commit/679b566622ec811c5e5d580f6a538f7a43006e05

This change broke AMD64 Windows7 SP1 3.x buildbot, see the logs for all errors:

http://buildbot.python.org/all/builders/AMD64%20Windows7%20SP1%203.x/builds/796/steps/test/logs/stdio

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9566] Compilation warnings under x64 Windows

2017-07-26 Thread Segev Finer

Changes by Segev Finer :


--
pull_requests: +2955

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9566] Compilation warnings under x64 Windows

2017-07-26 Thread Steve Dower

Steve Dower added the comment:


New changeset 5cff6379797967faabbb834a9eb154c3f0839489 by Steve Dower (Segev 
Finer) in branch 'master':
bpo-9566: Fixed _ssl module warnings (#2495)
https://github.com/python/cpython/commit/5cff6379797967faabbb834a9eb154c3f0839489


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9566] Compilation warnings under x64 Windows

2017-07-26 Thread Steve Dower

Steve Dower added the comment:


New changeset 679b566622ec811c5e5d580f6a538f7a43006e05 by Steve Dower (Segev 
Finer) in branch 'master':
bpo-9566: Fix some Windows x64 compiler warnings (#2492)
https://github.com/python/cpython/commit/679b566622ec811c5e5d580f6a538f7a43006e05


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9566] Compilation warnings under x64 Windows

2017-07-26 Thread Steve Dower

Steve Dower added the comment:


New changeset e7bc7aac3d4a7d92aa5913006b0198820882ca59 by Steve Dower (Segev 
Finer) in branch 'master':
bpo-9566: Fix a warning in Python/getargs.c (#2890)
https://github.com/python/cpython/commit/e7bc7aac3d4a7d92aa5913006b0198820882ca59


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9566] Compilation warnings under x64 Windows

2017-07-26 Thread Segev Finer

Changes by Segev Finer :


--
pull_requests: +2942

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9566] Compilation warnings under x64 Windows

2017-07-24 Thread Segev Finer

Changes by Segev Finer :


--
pull_requests: +2902

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9566] Compilation warnings under x64 Windows

2017-06-29 Thread Segev Finer

Changes by Segev Finer :


--
pull_requests: +2556

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9566] Compilation warnings under x64 Windows

2017-06-29 Thread Segev Finer

Segev Finer added the comment:

I submitted a PR which fixes some more warnings. The ones I haven't fixed are 
detailed in the PR description.

--
nosy: +Segev Finer
versions: +Python 3.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9566] Compilation warnings under x64 Windows

2017-06-29 Thread Segev Finer

Changes by Segev Finer :


--
pull_requests: +2551

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9566] Compilation warnings under x64 Windows

2017-06-12 Thread Steve Dower

Changes by Steve Dower :


--
pull_requests:  -2171

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9566] Compilation warnings under x64 Windows

2017-06-12 Thread Mark Lawrence

Changes by Mark Lawrence :


--
nosy:  -BreamoreBoy

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9566] Compilation warnings under x64 Windows

2017-06-11 Thread Segev Finer

Changes by Segev Finer :


--
pull_requests: +2171

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9566] Compilation warnings under x64 Windows

2015-09-24 Thread Mark Lawrence

Mark Lawrence added the comment:

I've got the latest output with all of the warnings but I'm not sure where I 
should attach it as #18295 and #18407 also apply.  There are also multiple 
deprecation warnings but I'm sure they've been discussed before.  Can somebody 
please advise, thanks.

--
versions: +Python 3.6 -Python 3.4

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9566] Compilation warnings under x64 Windows

2015-09-24 Thread Brian Curtin

Changes by Brian Curtin :


--
nosy:  -brian.curtin

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9566] Compilation warnings under x64 Windows

2015-02-13 Thread Steve Dower

Changes by Steve Dower steve.do...@microsoft.com:


--
nosy: +steve.dower

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9566
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9566] Compilation warnings under x64 Windows

2014-07-01 Thread Mark Lawrence

Mark Lawrence added the comment:

Are there any more warnings that need silencing or can this be closed as fixed? 
 How do I check for these warnings as I don't have a 64 bit machine?

--
nosy: +BreamoreBoy
versions: +Python 3.5 -Python 3.3

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9566
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9566] Compilation warnings under x64 Windows

2014-07-01 Thread STINNER Victor

STINNER Victor added the comment:

 How do I check for these warnings as I don't have a 64 bit machine?

Check buildbots. Example:
http://buildbot.python.org/all/builders/AMD64%20Windows7%20SP1%203.x/builds/4744/steps/compile/logs/warnings%20%28108%29

There are still open issues related to this one: #18295 at least.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9566
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9566] Compilation warnings under x64 Windows

2013-11-19 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 68fd86a83ece by Victor Stinner in branch 'default':
Issue #9566: compile.c uses Py_ssize_t instead of int to store sizes to fix
http://hg.python.org/cpython/rev/68fd86a83ece

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9566
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9566] Compilation warnings under x64 Windows

2013-11-19 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 8d3e85dfa46f by Victor Stinner in branch 'default':
Issue #9566, #19617: Fix compilation on Windows
http://hg.python.org/cpython/rev/8d3e85dfa46f

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9566
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9566] Compilation warnings under x64 Windows

2013-11-19 Thread Roundup Robot

Roundup Robot added the comment:

New changeset ee4da7291211 by Victor Stinner in branch 'default':
Issue #9566, #19617: New try to fix compilation on Windows
http://hg.python.org/cpython/rev/ee4da7291211

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9566
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9566] Compilation warnings under x64 Windows

2013-11-19 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 116bd550e309 by Victor Stinner in branch 'default':
Issue #9566, #19617: Fix more compiler warnings in compile.c on Windows 64-bit
http://hg.python.org/cpython/rev/116bd550e309

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9566
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9566] Compilation warnings under x64 Windows

2013-11-18 Thread STINNER Victor

STINNER Victor added the comment:

I forgot to mention this issue in the following changesets.

changeset:   87128:f0a7924fac56
user:Victor Stinner victor.stin...@gmail.com
date:Fri Nov 15 23:16:15 2013 +0100
files:   Modules/_randommodule.c
description:
Fix compiler warning on Windows 64-bit: explicit cast size_t to unsigned long


changeset:   87129:8adbd8a3a626
user:Victor Stinner victor.stin...@gmail.com
date:Fri Nov 15 23:21:11 2013 +0100
files:   Modules/_sre.c
description:
Fix compiler warning (especially on Windows 64-bit): don't truncate Py_ssize_t
to int


changeset:   87130:baab11a466ab
user:Victor Stinner victor.stin...@gmail.com
date:Fri Nov 15 23:26:25 2013 +0100
files:   Python/random.c
description:
Fix compiler warning in win32_urandom(): explicit cast to DWORD in
CryptGenRandom()


changeset:   87131:e086cb1c6e5a
user:Victor Stinner victor.stin...@gmail.com
date:Sat Nov 16 00:13:29 2013 +0100
files:   Python/marshal.c
description:
Fix compiler warning (on Windows 64-bit): explicit cast Py_ssize_t to unsigned
char, n is in range [0; 255] (a tuple cannot have a negative length)


changeset:   87132:cf399d13a707
user:Victor Stinner victor.stin...@gmail.com
date:Sat Nov 16 00:16:58 2013 +0100
files:   Include/asdl.h
description:
Fix compiler warning on Windows 64-bit: asdl_seq_SET() stores the index 
parameter
into a Py_ssize_t, instead of an int


changeset:   87133:309d855ebc3e
user:Victor Stinner victor.stin...@gmail.com
date:Sat Nov 16 00:17:22 2013 +0100
files:   Modules/_ctypes/_ctypes.c
description:
Fix compiler warning on Windows 64 bit: _init_pos_args() result type is
Py_ssize_t, not int


changeset:   87134:7cd4c3e9e310
user:Victor Stinner victor.stin...@gmail.com
date:Sat Nov 16 00:18:58 2013 +0100
files:   Modules/socketmodule.c
description:
Fix sock_recvfrom_guts(): recvfrom() size is limited to an int on Windows, not
on other OSes!


changeset:   87135:9e25367095c4
user:Victor Stinner victor.stin...@gmail.com
date:Sat Nov 16 00:27:16 2013 +0100
files:   Modules/_hashopenssl.c
description:
Fix compiler warnings on Windows 64 bit: add an explicit cast from Py_ssize_t
to int, password.len was checked for being smaller than INT_MAX.


changeset:   87229:ac4272df1af6
user:Victor Stinner victor.stin...@gmail.com
date:Mon Nov 18 01:07:38 2013 +0100
files:   Parser/grammar.c
description:
Fix compiler warnings on Windows 64-bit in grammar.c

INT_MAX states and labels should be enough for everyone


changeset:   87230:19e900e3033f
user:Victor Stinner victor.stin...@gmail.com
date:Mon Nov 18 01:09:51 2013 +0100
files:   Parser/parsetok.c
description:
Fix a compiler warning on Windows 64-bit in parsetok.c

Python parser doesn't support lines longer than INT_MAX bytes yet


changeset:   87231:103998db4407
user:Victor Stinner victor.stin...@gmail.com
date:Mon Nov 18 01:21:12 2013 +0100
files:   Python/getargs.c
description:
Use Py_ssize_t type for sizes in getargs.c

Fix compiler warnings on Windows 64-bit


changeset:   87232:0f7f1f2121a1
user:Victor Stinner victor.stin...@gmail.com
date:Mon Nov 18 01:24:31 2013 +0100
files:   Modules/_sqlite/connection.c
description:
sqlite: raise an OverflowError if the result is longer than INT_MAX bytes

Fix a compiler warning on Windows 64-bit


changeset:   87233:855e172bcac4
user:Victor Stinner victor.stin...@gmail.com
date:Mon Nov 18 01:27:30 2013 +0100
files:   Modules/_sqlite/row.c
description:
Fix a compiler warning on Windows 64-bit: _sqlite module


changeset:   87234:40d25b2b93f0
user:Victor Stinner victor.stin...@gmail.com
date:Mon Nov 18 01:36:29 2013 +0100
files:   Modules/_sqlite/statement.c
description:
sqlite: raise an OverflowError if a string or a BLOB is longer than INT_MAX
bytes

Fix compiler warnings on Windows 64-bit


changeset:   87235:d1dc7888656f
user:Victor Stinner victor.stin...@gmail.com
date:Mon Nov 18 02:05:31 2013 +0100
files:   Python/getargs.c
description:
PY_FORMAT_SIZE_T should not be used with PyErr_Format(), PyErr_Format(%zd) is
portable


changeset:   87236:2a01ca4b0edc
user:Victor Stinner victor.stin...@gmail.com
date:Mon Nov 18 02:07:29 2013 +0100
files:   Modules/_sqlite/statement.c
description:
sqlite: Use Py_ssize_t to store a size instead of an int

Fix a compiler warning on Windows 64-bit

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9566
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9566] Compilation warnings under x64 Windows

2013-06-24 Thread STINNER Victor

STINNER Victor added the comment:

I created #18294 for the warnings in the zlib module.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9566
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9566] Compilation warnings under x64 Windows

2013-06-24 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 5c407b64920c by Victor Stinner in branch 'default':
Issue #9566: _io: Use Py_SAFE_DOWNCAST for fix a compiler warning on Windows x64
http://hg.python.org/cpython/rev/5c407b64920c

New changeset 931e1bc090f6 by Victor Stinner in branch 'default':
Issue #9566: zlib: Explicit cast to unsigned int to fix a compiler warning on 
Windows x64
http://hg.python.org/cpython/rev/931e1bc090f6

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9566
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9566] Compilation warnings under x64 Windows

2013-06-24 Thread Roundup Robot

Roundup Robot added the comment:

New changeset c75ab7b802df by Victor Stinner in branch 'default':
Issue #9566: _winapi.WriteFile() now truncates length to DWORD_MAX (4294967295)
http://hg.python.org/cpython/rev/c75ab7b802df

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9566
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9566] Compilation warnings under x64 Windows

2013-06-24 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 72087ebf83f0 by Victor Stinner in branch 'default':
Issue #9566: Fix a compiler warning on Windows x64
http://hg.python.org/cpython/rev/72087ebf83f0

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9566
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9566] Compilation warnings under x64 Windows

2013-06-24 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 6b4d279508a3 by Victor Stinner in branch 'default':
Issue #9566: Fix a compiler warning in tupleiter_setstate() on Windows x64
http://hg.python.org/cpython/rev/6b4d279508a3

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9566
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9566] Compilation warnings under x64 Windows

2013-06-24 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 5a72adc7c8f7 by Victor Stinner in branch 'default':
Issue #9566: pystrtod.c: Fix a compiler warnings on Windows x64
http://hg.python.org/cpython/rev/5a72adc7c8f7

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9566
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9566] Compilation warnings under x64 Windows

2013-06-24 Thread Roundup Robot

Roundup Robot added the comment:

New changeset c1a400501db6 by Victor Stinner in branch 'default':
Issue #9566: recv(), recvfrom(), send(), sendall() and sendto() methods
http://hg.python.org/cpython/rev/c1a400501db6

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9566
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9566] Compilation warnings under x64 Windows

2013-06-24 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 3a393fc86b29 by Victor Stinner in branch 'default':
Issue #9566: More long/Py_ssize_t fixes in tuple and list iterators (it_index)
http://hg.python.org/cpython/rev/3a393fc86b29

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9566
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9566] Compilation warnings under x64 Windows

2013-06-04 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 46401ce03547 by Victor Stinner in branch 'default':
Issue #9566: Fix compiler warning on Windows 64-bit in _bz2module.c
http://hg.python.org/cpython/rev/46401ce03547

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9566
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9566] Compilation warnings under x64 Windows

2013-06-04 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 93f4b32fc95c by Victor Stinner in branch 'default':
Issue #9566: Fix a compiler warning on Windows 64-bit in namespace_init()
http://hg.python.org/cpython/rev/93f4b32fc95c

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9566
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9566] Compilation warnings under x64 Windows

2013-06-04 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 5dcbd5d8d004 by Victor Stinner in branch 'default':
Issue #9566: Fix compiler warning on Windows 64-bit
http://hg.python.org/cpython/rev/5dcbd5d8d004

New changeset 41b8be55b160 by Victor Stinner in branch 'default':
Issue #9566: Fix compiler warning on Windows 64-bit
http://hg.python.org/cpython/rev/41b8be55b160

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9566
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9566] Compilation warnings under x64 Windows

2013-06-04 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 36c35a1893fe by Victor Stinner in branch 'default':
Issue #9566: Fix compiler warning on Windows 64-bit
http://hg.python.org/cpython/rev/36c35a1893fe

New changeset 88a21c5a97ef by Victor Stinner in branch 'default':
Issue #9566: Fix compiler warning on Windows 64-bit
http://hg.python.org/cpython/rev/88a21c5a97ef

New changeset aeebbae8c74c by Victor Stinner in branch 'default':
Issue #9566: Fix compilater warnings on Windows 64-bit
http://hg.python.org/cpython/rev/aeebbae8c74c

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9566
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9566] Compilation warnings under x64 Windows

2013-05-17 Thread STINNER Victor

STINNER Victor added the comment:

Oh, I fixed some warnings yesterday, but I forgot this issue.

changeset:   83802:ef5dd5bda323
user:Victor Stinner victor.stin...@gmail.com
date:Fri May 17 00:12:04 2013 +0200
files:   Python/getargs.c Python/traceback.c
description:
Fix compilater warnings on Windows 64-bit


changeset:   83801:16a00dd78cd0
user:Victor Stinner victor.stin...@gmail.com
date:Fri May 17 00:04:56 2013 +0200
files:   Python/formatter_unicode.c
description:
Fix a compilater warning on Windows 64-bit


changeset:   83800:e5dc97fb304d
user:Victor Stinner victor.stin...@gmail.com
date:Thu May 16 23:48:01 2013 +0200
files:   Python/ceval.c
description:
Fix a compilater warning on Windows 64-bit

idx variable is used for a tuple indexn so use Py_ssize_t (not int).

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9566
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9566] Compilation warnings under x64 Windows

2013-05-16 Thread Ezio Melotti

Changes by Ezio Melotti ezio.melo...@gmail.com:


--
nosy: +terry.reedy
priority: low - normal
stage:  - patch review
versions: +Python 3.3, Python 3.4 -Python 3.2

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9566
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9566] Compilation warnings under x64 Windows

2013-05-16 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Just a note: Today I got warnings for 4 or 5 files when compiling  with VC 
express (32 bit) on 64-bit Win 7.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9566
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9566] Compilation warnings under x64 Windows

2012-10-30 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 96fc87997ce9 by Victor Stinner in branch 'default':
Issue #9566: Explicit downcast to fix compiler warnings on Win64
http://hg.python.org/cpython/rev/96fc87997ce9

New changeset dabe2486e2ce by Victor Stinner in branch 'default':
Issue #9566: Use the right type to fix a compiler warnings on Win64
http://hg.python.org/cpython/rev/dabe2486e2ce

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9566
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9566] Compilation warnings under x64 Windows

2012-07-21 Thread Florent Xicluna

Florent Xicluna florent.xicl...@gmail.com added the comment:

Attached file is a copy of the remaining warnings on the AMD64 Windows7 SP1 3.x 
builder.

--
keywords: +buildbot
nosy: +flox
Added file: http://bugs.python.org/file26465/warnings64.log

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9566
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9566] Compilation warnings under x64 Windows

2011-07-07 Thread Roundup Robot

Roundup Robot devnull@devnull added the comment:

New changeset 43fd627cc060 by Victor Stinner in branch 'default':
Issue #9566: cast unsigned int to Py_ssize_t in md5 and sha1 modules
http://hg.python.org/cpython/rev/43fd627cc060

--
nosy: +python-dev

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9566
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9566] Compilation warnings under x64 Windows

2011-01-10 Thread STINNER Victor

STINNER Victor victor.stin...@haypocalc.com added the comment:

 [readinst) should return a negative value on error, whereas it 
 returns the string length which is always positive

Fixed by r87911.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9566
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9566] Compilation warnings under x64 Windows

2011-01-10 Thread STINNER Victor

Changes by STINNER Victor victor.stin...@haypocalc.com:


Removed file: http://bugs.python.org/file20263/pyexpat.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9566
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9566] Compilation warnings under x64 Windows

2011-01-10 Thread STINNER Victor

STINNER Victor victor.stin...@haypocalc.com added the comment:

socketmodule_int.patch: Fix similar to the fix for #9611: clamp length to 
INT_MAX on Windows for recv(), recvfrom(), send() and sendto().

--
Added file: http://bugs.python.org/file20345/socketmodule_int.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9566
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9566] Compilation warnings under x64 Windows

2011-01-10 Thread STINNER Victor

STINNER Victor victor.stin...@haypocalc.com added the comment:

ssl_sock_fd_int.patch: add SOCKET_T_AS_INT(fd) macro to cast a socket 
descriptor (SOCKET_T) to int. I choosed a macro just to not have to repeat a 
comment twice :-)

It looks like it is a safe to cast SOCKET_T to int. My comment:

/* On Windows, SOCKET_T is an offset in per-process handle table.
   The per-process limit on kernel handles is 2^24. Kernel Objects:
   http://msdn.microsoft.com/en-us/library/ms724485%28VS.85%29.aspx
*/

--
Added file: http://bugs.python.org/file20346/ssl_sock_fd_int.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9566
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9566] Compilation warnings under x64 Windows

2011-01-10 Thread STINNER Victor

STINNER Victor victor.stin...@haypocalc.com added the comment:

 On Windows, SOCKET_T is an offset in per-process handle table.
 The per-process limit on kernel handles is 2^24. Kernel Objects:

Reference: http://www.mail-archive.com/openssl-dev@openssl.org/msg23781.html

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9566
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9566] Compilation warnings under x64 Windows

2011-01-10 Thread STINNER Victor

STINNER Victor victor.stin...@haypocalc.com added the comment:

ssl_write.patch: always clamp SSL_Write() size to INT_MAX. This patch fixes 
also an overflow if Py_ssize_t is 32 bits (if the size is bigger than INT_MAX).

--
Added file: http://bugs.python.org/file20347/ssl_write.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9566
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9566] Compilation warnings under x64 Windows

2011-01-10 Thread STINNER Victor

STINNER Victor victor.stin...@haypocalc.com added the comment:

hash.patch: continue my fix on md5, sha1, sha256, sha512.

--
Added file: http://bugs.python.org/file20348/hash.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9566
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9566] Compilation warnings under x64 Windows

2011-01-10 Thread STINNER Victor

STINNER Victor victor.stin...@haypocalc.com added the comment:

_sre.patch: store sre_match() result in Py_ssize_t instead of int.

--
Added file: http://bugs.python.org/file20349/_sre.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9566
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9566] Compilation warnings under x64 Windows

2011-01-10 Thread STINNER Victor

STINNER Victor victor.stin...@haypocalc.com added the comment:

... and issue9566.patch: various fixes. Interesting parts:

---
-id = PyLong_FromLong((Py_uintptr_t) self);
+id = PyLong_FromVoidPtr(self);
---

---
 LOCAL(PyObject*)
-expat_parse(XMLParserObject* self, char* data, int data_len, int final)
+expat_parse(XMLParserObject* self, char* data, Py_ssize_t data_len, int final)
 {
 int ok;
 
-ok = EXPAT(Parse)(self-parser, data, data_len, final);
+if (data_len  INT_MAX) {
+PyErr_SetString(PyExc_OverflowError, length doesn't fit in an int);
+return NULL;
+}
+
+ok = EXPAT(Parse)(self-parser, data, (int)data_len, final);
---

---
-long hash = PyObject_Hash(arg);
+Py_hash_t hash = PyObject_Hash(arg);
---

--
Added file: http://bugs.python.org/file20350/issue9566.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9566
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9566] Compilation warnings under x64 Windows

2011-01-04 Thread Ralf Schmitt

Changes by Ralf Schmitt sch...@gmail.com:


--
nosy: +schmir

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9566
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9566] Compilation warnings under x64 Windows

2011-01-04 Thread STINNER Victor

STINNER Victor victor.stin...@haypocalc.com added the comment:

r87733 fixes some conversions in:

 * Python/pythonrun.c
 * Objects/codeobject.c
 * Objects/typeobject.c
 * Objects/listobject.c
 * Modules/_ctypes/_ctypes.c
 * Modules/sha512module.c
 * Modules/unicodedata.c
 * Modules/selectmodule.c
 * Modules/pyexpat.c
 * Modules/audioop.c
 * Modules/sha1module.c
 * Modules/sha256module.c
 * Modules/_testcapimodule.c
 * Modules/md5module.c

For md5, sha1, sha256 and sha512: a smaller type (int) can be used for the 
local n variable. I don't know if it impacts performances or not. md5 and sha1 
used unsigned long, sha256 and sha512 used int.

--
nosy: +haypo

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9566
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9566] Compilation warnings under x64 Windows

2011-01-04 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc amaur...@gmail.com added the comment:

r87733 in pyexpat.c modified a call to PyErr_Format with a %zi format code.
This format does not seem to be supported. %zd should be used instead.

--
nosy: +amaury.forgeotdarc

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9566
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9566] Compilation warnings under x64 Windows

2011-01-04 Thread STINNER Victor

STINNER Victor victor.stin...@haypocalc.com added the comment:

#10823 has been marked as a duplicate of this issue.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9566
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9566] Compilation warnings under x64 Windows

2011-01-04 Thread Martin v . Löwis

Martin v. Löwis mar...@v.loewis.de added the comment:

haypo: please avoid introducing explicit casts (such as the one in pyexpat.c). 
Use SAFECASTs instead. If you are absolutely certain that a cast cannot 
possibly truncate, add a comment explaining why that is. In the specific case, 
I think it actually *is* possible that the cast truncates, because the case 
that read() returned too many bytes is incorrectly handled (it should set len 
to -1).

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9566
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9566] Compilation warnings under x64 Windows

2011-01-04 Thread STINNER Victor

STINNER Victor victor.stin...@haypocalc.com added the comment:

amaury r87733 in pyexpat.c modified a call to PyErr_Format with a %zi
amaury format code. This format does not seem to be supported. %zd
amaury should be used instead.

Oh, that's surprising. Why %zd is supported but not %zi?

PyUnicode_FromFormatV() supports %d, %ld, %lld, %zd, %i, but not %li, %lli or 
%zi. Before fixing PyUnicode_FromFormatV(), I fixed pyexpat.c: r87747.

MvL If you are absolutely certain that a cast cannot possibly truncate, 
MvL add a comment explaining why that is.

Ah yes, sorry, I forgot to add a comment: done in r87746.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9566
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9566] Compilation warnings under x64 Windows

2011-01-04 Thread STINNER Victor

STINNER Victor victor.stin...@haypocalc.com added the comment:

 Python\pystrtod.c(902) : 'function' : conversion from 'Py_ssize_t' to 'int', 
 possible loss of data
 Python\pystrtod.c(1023) : '=' : conversion from 'Py_ssize_t' to 'int', 
 possible loss of data

I asked dmalcolm on IRC if int or Py_ssize_t should be used:

this is the number of digits to use in the floating point representation, 
right? it strikes me that if you're overflowing an int, you're asking for a 
very very very long string (yes, INT_MAX is usually 2^31)

... looking at usage of precision seems to ultimately land in Python/dtoa.c, 
which uses int...

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9566
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9566] Compilation warnings under x64 Windows

2011-01-04 Thread Martin v . Löwis

Martin v. Löwis mar...@v.loewis.de added the comment:

 MvL If you are absolutely certain that a cast cannot possibly truncate, 
 MvL add a comment explaining why that is.
 
 Ah yes, sorry, I forgot to add a comment: done in r87746.

But the comment is actually wrong: It says

len = buf_size = INT_MAX (see above)

however, len  buf_size may happen, after this code:

if (len  buf_size) {
PyErr_Format(PyExc_ValueError,
 read() returned too much data: 
 %i bytes requested, %zd returned,
 buf_size, len);
goto finally;
}

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9566
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9566] Compilation warnings under x64 Windows

2011-01-04 Thread STINNER Victor

STINNER Victor victor.stin...@haypocalc.com added the comment:

 But the comment is actually wrong: It says
 
 len = buf_size = INT_MAX (see above)
 
 however, len  buf_size may happen, after this code:
 
 if (len  buf_size) {
 PyErr_Format(PyExc_ValueError,
  read() returned too much data: 
  %i bytes requested, %zd returned,
  buf_size, len);
 goto finally;
 }

Oh. Not only is the comment is wrong, but the code is also wrong. It
should return a negative value on error, whereas it returns the string
length which is always positive (except on a unlikely Py_ssize_t = int
overflow?).

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9566
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9566] Compilation warnings under x64 Windows

2011-01-04 Thread Martin v . Löwis

Martin v. Löwis mar...@v.loewis.de added the comment:

 Oh. Not only is the comment is wrong, but the code is also wrong. It
 should return a negative value on error, whereas it returns the string
 length which is always positive (except on a unlikely Py_ssize_t = int
 overflow?).

Right. See msg125367.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9566
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9566] Compilation warnings under x64 Windows

2011-01-04 Thread STINNER Victor

STINNER Victor victor.stin...@haypocalc.com added the comment:

pyexpat.patch: new try, does it look better?

--
keywords: +patch
Added file: http://bugs.python.org/file20263/pyexpat.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9566
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9566] Compilation warnings under x64 Windows

2010-09-13 Thread Jon Anglin

Changes by Jon Anglin jang...@fortresgrand.com:


--
nosy: +janglin

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9566
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9566] Compilation warnings under x64 Windows

2010-08-15 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

Created #9611 to report the FileIO 64-bit issue under Windows.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9566
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9566] Compilation warnings under x64 Windows

2010-08-15 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

The zlib warnings are genuine and there's a specific bug for 64-bitness of 
zlibmodule.c: #8650.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9566
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9566] Compilation warnings under x64 Windows

2010-08-15 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

Opened #9613 for 64-bitness of process ids.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9566
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9566] Compilation warnings under x64 Windows

2010-08-15 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

Opened #9614 for the _pickle issues (which look quite legitimate).

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9566
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9566] Compilation warnings under x64 Windows

2010-08-15 Thread Brian Curtin

Changes by Brian Curtin cur...@acm.org:


--
nosy: +brian.curtin

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9566
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9566] Compilation warnings under x64 Windows

2010-08-10 Thread Antoine Pitrou

New submission from Antoine Pitrou pit...@free.fr:

A 64-bit build under Windows produces many compilation warnings, mostly related 
to lossy conversions between different int sizes.
Some of these warnings appear harmless after analysis (are MS 64 bit compilers 
pickier than their 32 bit counterparts?).
It would probably be spammy to open a separate issue per file.

5..\Python\pythonrun.c(1210) : warning C4267: '=' : conversion from 'size_t' 
to 'int', possible loss of data

5..\Python\Python-ast.c(3403) : warning C4244: 'function' : conversion from 
'Py_ssize_t' to 'int', possible loss of data
5..\Python\Python-ast.c(3409) : warning C4244: 'initializing' : conversion 
from 'Py_ssize_t' to 'int', possible loss of data
5..\Python\Python-ast.c(3439) : warning C4244: 'function' : conversion from 
'Py_ssize_t' to 'int', possible loss of data
5..\Python\Python-ast.c(3445) : warning C4244: 'initializing' : conversion 
from 'Py_ssize_t' to 'int', possible loss of data
5..\Python\Python-ast.c(3498) : warning C4244: 'function' : conversion from 
'Py_ssize_t' to 'int', possible loss of data
5..\Python\Python-ast.c(3504) : warning C4244: 'initializing' : conversion 
from 'Py_ssize_t' to 'int', possible loss of data
5..\Python\Python-ast.c(3608) : warning C4244: 'function' : conversion from 
'Py_ssize_t' to 'int', possible loss of data
5..\Python\Python-ast.c(3614) : warning C4244: 'initializing' : conversion 
from 'Py_ssize_t' to 'int', possible loss of data
5..\Python\Python-ast.c(3633) : warning C4244: 'function' : conversion from 
'Py_ssize_t' to 'int', possible loss of data
5..\Python\Python-ast.c(3639) : warning C4244: 'initializing' : conversion 
from 'Py_ssize_t' to 'int', possible loss of data
5..\Python\Python-ast.c(3699) : warning C4244: 'function' : conversion from 
'Py_ssize_t' to 'int', possible loss of data
5..\Python\Python-ast.c(3705) : warning C4244: 'initializing' : conversion 
from 'Py_ssize_t' to 'int', possible loss of data
5..\Python\Python-ast.c(3724) : warning C4244: 'function' : conversion from 
'Py_ssize_t' to 'int', possible loss of data
5..\Python\Python-ast.c(3730) : warning C4244: 'initializing' : conversion 
from 'Py_ssize_t' to 'int', possible loss of data
5..\Python\Python-ast.c(3771) : warning C4244: 'function' : conversion from 
'Py_ssize_t' to 'int', possible loss of data
5..\Python\Python-ast.c(3777) : warning C4244: 'initializing' : conversion 
from 'Py_ssize_t' to 'int', possible loss of data
5..\Python\Python-ast.c(3796) : warning C4244: 'function' : conversion from 
'Py_ssize_t' to 'int', possible loss of data
5..\Python\Python-ast.c(3802) : warning C4244: 'initializing' : conversion 
from 'Py_ssize_t' to 'int', possible loss of data
5..\Python\Python-ast.c(3855) : warning C4244: 'function' : conversion from 
'Py_ssize_t' to 'int', possible loss of data
5..\Python\Python-ast.c(3861) : warning C4244: 'initializing' : conversion 
from 'Py_ssize_t' to 'int', possible loss of data
5..\Python\Python-ast.c(3892) : warning C4244: 'function' : conversion from 
'Py_ssize_t' to 'int', possible loss of data
5..\Python\Python-ast.c(3898) : warning C4244: 'initializing' : conversion 
from 'Py_ssize_t' to 'int', possible loss of data
5..\Python\Python-ast.c(4016) : warning C4244: 'function' : conversion from 
'Py_ssize_t' to 'int', possible loss of data
5..\Python\Python-ast.c(4022) : warning C4244: 'initializing' : conversion 
from 'Py_ssize_t' to 'int', possible loss of data
5..\Python\Python-ast.c(4041) : warning C4244: 'function' : conversion from 
'Py_ssize_t' to 'int', possible loss of data
5..\Python\Python-ast.c(4047) : warning C4244: 'initializing' : conversion 
from 'Py_ssize_t' to 'int', possible loss of data
5..\Python\Python-ast.c(4092) : warning C4244: 'function' : conversion from 
'Py_ssize_t' to 'int', possible loss of data
5..\Python\Python-ast.c(4098) : warning C4244: 'initializing' : conversion 
from 'Py_ssize_t' to 'int', possible loss of data
5..\Python\Python-ast.c(4117) : warning C4244: 'function' : conversion from 
'Py_ssize_t' to 'int', possible loss of data
5..\Python\Python-ast.c(4123) : warning C4244: 'initializing' : conversion 
from 'Py_ssize_t' to 'int', possible loss of data
5..\Python\Python-ast.c(4167) : warning C4244: 'function' : conversion from 
'Py_ssize_t' to 'int', possible loss of data
5..\Python\Python-ast.c(4173) : warning C4244: 'initializing' : conversion 
from 'Py_ssize_t' to 'int', possible loss of data
5..\Python\Python-ast.c(4192) : warning C4244: 'function' : conversion from 
'Py_ssize_t' to 'int', possible loss of data
5..\Python\Python-ast.c(4198) : warning C4244: 'initializing' : conversion 
from 'Py_ssize_t' to 'int', possible loss of data
5..\Python\Python-ast.c(4253) : warning C4244: 'function' : conversion from 
'Py_ssize_t' to 'int', possible loss of data
5..\Python\Python-ast.c(4259) : warning C4244: 'initializing' : conversion 
from 'Py_ssize_t' to 'int', possible loss of data
5..\Python\Python-ast.c(4326) : warning C4244: 

[issue9566] Compilation warnings under x64 Windows

2010-08-10 Thread Martin v . Löwis

Martin v. Löwis mar...@v.loewis.de added the comment:

This must be a duplicate report - this issue has been known for years, and 
Kristjan and others (including myself) volunteered to work on it, and did 
actually work on it.

I don't think it's necessary to have a bug report in the bug tracker for it. If 
you find a place that you would like to fix, just go ahead and fix it.

Please keep in mind the following principles:
- if a value can reasonably overflow an int, change the data type to something 
larger (typically Py_ssize_t)
- if the value can overflow in principle, but likely won't, and  it is 
difficult to fix the data type (e.g. because it's at a system interface), make 
a range check, raise a Python exception, and then SAFECAST the value.
- if the value shouldn't overflow (i.e. you are believe from the data flow or 
other invariants that it can't happen), use a safecast
- if you are certain that the value can't overflow (e.g. if you are converting 
the result of a sizeof of some structure), use a regular cast, along with a 
comment

This leaves us with a number of cases where there are pragmatic Python 
limitations (such as the data type for line numbers, or the number of values 
when building a tuple in source) which make it impossible to get overflows in 
the current implementation. Such limitations should be collected in some place, 
and then SAFECASTs should be added, along with asserts at startup (e.g. that a 
certain datatype has no more than 2 bytes).

--
nosy: +loewis

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9566
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com