Re: Avoiding == and = mixup in if statements
Re: Avoiding == and = mixup in if statements
- Subject: Re: Avoiding == and = mixup in if statements
- From: Wade Tregaskis <email@hidden>
- Date: Fri, 21 May 2004 13:29:50 +1000
Java disallows stuff like
if (myObject=nil) { dosomething }
Is it possible to maybe disallow the same potential error when I'm
writing obj-c programs? Could I do something with the pre-processor
perhaps?
You can display warnings for this by using the flag "-Wparentheses".
This will require you to add an extra set of parentheses to avoid the
warning, indicating you really do want to perform the assignment. You
can convert this to an error using "-Werror", although that will
convert all warnings of any sort into errors.
Wade Tregaskis (aim: wadetregaskis)
-- Sed quis custodiet ipsos custodes?
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.