Gabriel Sechan wrote:

Not sure I see the value of it, but I understand it.  They still made the right 
decision-  unused variables should be optimized out.  Preferably with a 
warning.  This would need to be special cased, and I can easily see why they 
don't want to do that-  special cases lead to bugs, they should only be used 
when necessary.  Since there's workarounds here, there's no reason to do so.  
Its not like that variable has special meaning under the C standard.  Sorry it 
makes more work for you, but its the right technical decision.

Annoying, no wrap as I'm viewing the above sentence. Hopefully it wraps when it's sent.

I disagree. The program should do what the programmer told it to do and the compiler should not make changes that will make it do something else. The exception is if I tell it to make the change. If the programmer told it to do the wrong thing, then the programmer should fix it, not the compiler (How does the compiler know that it's really fixing anything, as opposed to actually breaking something?)

This is where I see a problem with "optimization" in a lot of different compilers I've used: they make unexpected changes when they shouldn't during the course of optimizing. If a programmer wants to put a string into an executable such that it can be read later, it should be easy to do so. It used to be easy (as Carl has stated).

Now it has become more difficult with a compiler second guessing the engineer.

PGA
--
Paul G. Allen, BSIT/SE
Owner, Sr. Engineer
Random Logic Consulting Services
www.randomlogic.com

--
[email protected]
http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-lpsg

Reply via email to