For loop variable issue

I'm trying to use a for loop to incorperate a dead band in to power switching application how ever the only way that the for loop with actually show any effect is ifthe variable is a float, if I try and use int even if I do "for(int i=0;i<35000;i++);" it won't delay the switching at all, however if iuse float,
"for(float i=0;i<75;i++);" i get the same result as using delayMicroseconds(30);.

Anyone have any ideas why its not letting the int version work?

Yes. The optimizer removes the loop because it has no side effects. Try making the loop variable global or volatile.

yep that worked thank you...but why does the optimizer remove the loop if its a int variable, but not a float variable?

An int going to 35000?
No. That won't work.

Multi-8-bit-ISP:
yep that worked thank you...but why does the optimizer remove the loop if its a int variable, but not a float variable?

It has to do with the way float is implemented on AVR processors. From the compiler's perspective, the code does have side effects.

Be sure to heed AWOL's warning.

Yes, GCC removes loops with no effect. If you want a timing loop you need something in the loop that the compiler will not remove. If you make the loop index volatile or static/global it can have other effects if you use that variable elsewhere. That being said, I suspect most Arduino code is not performance heavy.