• 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: Annoying warning: statement with no effect
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Annoying warning: statement with no effect


  • Subject: Re: Annoying warning: statement with no effect
  • From: "Clark S. Cox III" <email@hidden>
  • Date: Mon, 11 Nov 2002 15:01:09 -0500

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


On Monday, Nov 11, 2002, at 14:39 US/Eastern, Jonathan Jackel wrote:

Several of the for loops in my projects are generating a compiler warning
stating "statement with no effect". But the statements all have effects and
behave as intended. For instance:

for (r = [addRowsField intValue]; r--; r == 0)
[self createNewPoint];


This statement works exactly as you would expect. The variable r starts
with the number in a field, decrements with each loop, and stops when r
reaches zero.

Anyone else seen this? What's the cure?


I think you mean:

for (r = [addRowsField intValue]; r != 0; r-- )
[self createNewPoint];

The way you had it before, the "r == 0" statement indeed had no effect.

- -- http://homepage.mac.com/clarkcox3/
email@hidden
Clark S. Cox, III
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (Darwin)

iEYEARECAAYFAj3QDIsACgkQd6STocYT1xUhCACfTzJWyNCX5UhIb2nzJhjurI1Y
SQ8Anioj/NfBJucw/rl7lYwGNZ4xjwfg
=UPD+
-----END PGP SIGNATURE-----
_______________________________________________
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.

  • Follow-Ups:
    • Connection warning icons?
      • From: Sam Griffith <email@hidden>
References: 
 >Annoying warning: statement with no effect (From: Jonathan Jackel <email@hidden>)

  • Prev by Date: Re: "weak link" framework refs for 10.1 compatibility?
  • Next by Date: Re: Annoying warning: statement with no effect
  • Previous by thread: Annoying warning: statement with no effect
  • Next by thread: Connection warning icons?
  • Index(es):
    • Date
    • Thread