Message87712
> size = Py_SIZE(a) * n; > > The multiplication should be safe from overflow, and I don't get > any warning at all either with this rewrite (using -O3 -Wall -Wextra - > Wsigned-overflow=5) or from the original code, so there's nothing to > silence. This is puzzling, isn't it? It *could* overflow, could it not? >> I think there is a second solution: perform the multiplication >> unsigned in the first place. > > That would work too. I find the above code clearer, though. I agree in this case. In general, I'm not convinced that it is always possible to rewrite the code in that way conveniently. | |
Date | User | Action | Args | 2009-05-13 21:32:42 | loewis | set | recipients: + loewis, gvanrossum, nnorwitz, gregory.p.smith, mark.dickinson, pitrou, vstinner, christian.heimes, alexandre.vassalotti, donmez, matejcik | 2009-05-13 21:32:41 | loewis | link | issue1621 messages | 2009-05-13 21:32:40 | loewis | create | | |