• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: CriticalAlert
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: CriticalAlert


  • Subject: Re: CriticalAlert
  • From: David Remahl <email@hidden>
  • Date: Thu, 20 Dec 2001 22:36:26 +0100

On the other hand, the following construct is one I use very often in Cocoa:

NSArray* myArray = [NSArray arrayWithWhateverInitMethod:NULL];
NSEnumerator* myEnum = [myArray objectEnumerator];
id myStr = NULL;

while( myStr = [myEnum nextObject] )
{
// do whatever
}

That would generate a warning, would it not? And I would have to manually
disable that warning. I understand that the coding style of some people
would be served by a warning about this, but I do not know if one exists in
gcc...Search the docs...

/ david

> And, of course, make sure you enable warnings, and READ THEM. CodeWarrior
> will warn when you use if (x=y) (and a warning is appropriate, it is legal
> syntax, it's equivalent to x=y; if (x)), haven't encountered this with PB
> yet.
>
> Donald
>
> on 12/20/01 2:52 PM, Steve Bird at email@hidden wrote:
>
>> I came to the conclusion that anyone (me included) who couldn't remember
>> to use double equals, wouldn't remember to put the constant first, either.
>> It was a struggle to remember to put the constant first. It was a
>> lesser struggle to check the double-equals than to re-arrange the
>> arguments to the comparison operator.
>> And now it's second nature.


  • Follow-Ups:
    • Re: CriticalAlert
      • From: Kurt Revis <email@hidden>
    • Re: CriticalAlert
      • From: Andrew Pinski <email@hidden>
References: 
 >Re: CriticalAlert (From: Donald Brown <email@hidden>)

  • Prev by Date: Re: CriticalAlert
  • Next by Date: Re: Silly question
  • Previous by thread: Re: CriticalAlert
  • Next by thread: Re: CriticalAlert
  • Index(es):
    • Date
    • Thread