This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author mark.dickinson
Recipients alexandre.vassalotti, christian.heimes, donmez, gregory.p.smith, gvanrossum, loewis, mark.dickinson, matejcik, nnorwitz, pitrou, vstinner
Date 2009-05-14.09:00:15
SpamBayes Score 1.7467747e-07
Marked as misclassified No
Message-id <1242291620.45.0.0551263828295.issue1621@psf.upfronthosting.co.za>
In-reply-to
Content
> This is puzzling, isn't it?

I don't see why.  There's nothing in -Wall -Wextra -Wsigned-overflow
that asks for warnings for code that might overflow. Indeed, I don't
see how any compiler could reasonably provide such warnings without
flagging (almost) every occurrence of arithmetic on signed integers
as suspect.[*] 

The -ftrapv option is useful for catching genuine signed-integer
overflows at runtime, but it can still only catch those cases
that actually get exercised (e.g., by the Python test suite).


[*] Even some operations on unsigned integers would have to be
flagged: the C expression "(unsigned short)x * (unsigned short)y"
also has the potential to invoke undefined behaviour, thanks to
C's integer promotion rules.
History
Date User Action Args
2009-05-14 09:00:21mark.dickinsonsetrecipients: + mark.dickinson, gvanrossum, loewis, nnorwitz, gregory.p.smith, pitrou, vstinner, christian.heimes, alexandre.vassalotti, donmez, matejcik
2009-05-14 09:00:20mark.dickinsonsetmessageid: <1242291620.45.0.0551263828295.issue1621@psf.upfronthosting.co.za>
2009-05-14 09:00:18mark.dickinsonlinkissue1621 messages
2009-05-14 09:00:17mark.dickinsoncreate