Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
C Programming
Memory corruption on freeing a pointer to pointer
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
Reply to thread
Message
[QUOTE="James Kuyper, post: 5113175"] On 08/26/2013 03:18 PM, Ike Naar wrote: .... Of course not - the only argument ever presented for Yoda Conditions is protection against the possibility of mistyping = instead of ==. Such protection is only needed when one of the operands is an lvalue; such protection is only possible if the other is not an lvalue. It is neither needed nor possible in this case. The relevant property is lvalueness. If you're writing code so obfuscated that it leaves you uncertain which expressions are lvalues, you've got bigger problems than can be dealt with by using Yoda conditions. Nothing that occurs at runtime can change whether or not a given expression is an lvalue. Do you know of any other commutative operators for which a common typo converts them into a different operator for which one order is a constraint violation, and the other is perfectly legal code that does something quite different from what it would have done without the typo? The other operator is, of course, necessarily not commutative. There might be some other such pair of operators - I don't claim any certainty about that. However, but I think the ==/= typo is overwhelmingly the most common such pair. [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
C Programming
Memory corruption on freeing a pointer to pointer
Top