[asterisk-dev] [asterisk-commits] mmichelson: branch 1.4 r114226 - /branches/1.4/apps/app_chanspy.c

Daniel Hazelbaker daniel at highdesertchurch.com
Fri Apr 18 12:46:40 CDT 2008


        -Wshadow
            Warn whenever a local variable shadows another local  
variable,
            parameter or global variable or whenever a built-in  
function is
            shadowed.

I generally just always keep it on. :)

Daniel

On Apr 18, 2008, at 5:38 AM, Kevin P. Fleming wrote:

> SVN commits to the Asterisk project wrote:
>> Author: mmichelson
>> Date: Thu Apr 17 16:03:29 2008
>> New Revision: 114226
>>
>> URL: http://svn.digium.com/view/asterisk?view=rev&rev=114226
>> Log:
>> Declaration of the peer channel in this scope was making it so the  
>> peer variable defined
>> in the outer scope was never set properly, therefore making  
>> iterating through the channel
>> list always restart from the beginning. This bug would have  
>> affected anyone who called
>> chanspy without specifying a first argument.
>
> I believe I have seen GCC emit warnings when this situation occurs (a
> local variable masking a global one), so we should find a way to get  
> it
> to do that when dev-mode is enabled.
>
> -- 
> Kevin P. Fleming
> Director of Software Technologies
> Digium, Inc. - "The Genuine Asterisk Experience" (TM)
>
> _______________________________________________
> --Bandwidth and Colocation Provided by http://www.api-digital.com--
>
> asterisk-dev mailing list
> To UNSUBSCRIBE or update options visit:
>   http://lists.digium.com/mailman/listinfo/asterisk-dev
>




More information about the asterisk-dev mailing list