Re: [PATCH] Fix some sparse warnings

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Stefan Beller <stefanbeller@xxxxxxxxxxxxxx> writes:

> And the parse_object_buffer looks like this with respect to the eaten 
> variable:
> 	struct object *parse_object_buffer(...)
> 	{
> 		int eaten = 0;
> 		if (something)
> 			return NULL;
> 		...
> 		if (something_different)
> 			eaten=1;
> 		*eaten_p = eaten;
> 	}
> ...
> Was there a particular idea or goal behind first having a local eaten
> variable, which later near the correct return of the function was used to set the 
> eaten_p?

I didn't run "blame" to see the evolution of this function, but I
suspect that the original code, when the "eaten" local variable was
introduced, very much tried to do exactly what you suspect.  The
early return codepaths you see in today's code may be much newer,
added without much thinking about the exact issue you are bringing
up.

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]