[Python-checkins] r80819 - python/trunk/Python/pystrtod.c

Eric Smith eric at trueblade.com
Wed May 5 22:58:11 CEST 2010


I dislike this change. If for some reason we ever decide to make this 
condition not be an error (by removing the assert) then the deleted line 
is needed. What's the harm of leaving it in?

If any change must be made (and I don't think it does), I'd comment out 
both the strncpy and the increment. And put in a comment explaining why 
they've been commented out.

Eric.

brett.cannon wrote:
> Author: brett.cannon
> Date: Wed May  5 22:35:24 2010
> New Revision: 80819
> 
> Log:
> Remove an unnecessary variable assignment.
> 
> Found using Clang's static analyzer.
> 
> 
> Modified:
>    python/trunk/Python/pystrtod.c
> 
> Modified: python/trunk/Python/pystrtod.c
> ==============================================================================
> --- python/trunk/Python/pystrtod.c	(original)
> +++ python/trunk/Python/pystrtod.c	Wed May  5 22:35:24 2010
> @@ -1005,7 +1005,6 @@
>  			/* shouldn't get here: Gay's code should always return
>  			   something starting with a digit, an 'I',  or 'N' */
>  			strncpy(p, "ERR", 3);
> -			p += 3;
>  			assert(0);
>  		}
>  		goto exit;
> _______________________________________________
> Python-checkins mailing list
> Python-checkins at python.org
> http://mail.python.org/mailman/listinfo/python-checkins
> 



More information about the Python-checkins mailing list