----------------------------------------
> Date: Tue, 13 Nov 2007 00:01:55 -0800
> From: [EMAIL PROTECTED]
> To: [email protected]
> Subject: Re: gcc optimizes out program ID string
> 
> On Nov 12, 2007 11:15 PM, Gabriel Sechan  wrote:
>>
>> I don't think so.  I expect unused variables to be optimized out.  All of 
>> them.  That's the least surprising thing to do, since they aren't needed.  
>> Why keep this one special one around, for some odd use case that I don't 
>> quite get.
> 
> Let me try to explain the odd-use case so that you can get it.
> 
> One wants to plant a marker inside an object file that can be easily
> retrieved to indicate the particular source file that produced that
> object file.  The same marker should be propagated to the executable
> file that may be a combination of several object files.
> 
> Until gcc4  this could be done in a simple manner that even I could
> remember.  There are standard tools to retrieve the marker(s) from the
> object file or the executable.  They work with standard tools to plant
> the original marker in the source file.
> 
> Got it yet?
> 
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.

Gabe
_________________________________________________________________
Help yourself to FREE treats served up daily at the Messenger Café. Stop by 
today.
http://www.cafemessenger.com/info/info_sweetstuff2.html?ocid=TXT_TAGLM_OctWLtagline
--
[email protected]
http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-lpsg

Reply via email to