Martin v. Löwis added the comment:

>> I think the feature is somewhat desirable; I agree code combining
>> different types in MIN or MAX is flawed - if it is intentional, asking
>> for an explicit cast is not asking too much.
>
> I don't agree. Trying to battle with C's semantics doesn't seem very
> productive, especially if it's only done in a single pair of macros.

What do you disagree with? That "combining different types in MIN and MAX
is flawed"? Or that "asking for an explicit cast is not asking too much"?

Whether or not the patch is an appropriate measure is only the second
question - what I said is that the kind of code that it detects is indeed
flawed. If you disagree, can you kindly give an example where mixing types
in min and max would be legitimate?

For the specific case of mixing signed and unsigned, there is wide-spread
agreement that people should avoid it, and some compilers detect the flawed
code quite well. Some cases are defined to have undefined behavior; other
cases do have well-defined behavior, but many C developers are unaware of
what the exact semantics is.

Mixing integers with pointers is already detected by compilers sufficiently.

Mixing integers with floating point isn't really an issue in Python's
source code, so I don't worry about this.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue15530>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to