From: Junio C Hamano Date: Thu, 04 Aug 2016 18:09:48 GMT Subject: Re: [PATCH v6 07/16] merge-recursive: avoid returning a wholesale struct Message-ID: In-Reply-To: <4cbe2757bd921a202c359382086fadeb2616434a.1470051326.git.johannes.schindelin@gmx.de> Johannes Schindelin writes: > It is technically allowed, as per C89, for functions' return type to > be complete structs (i.e. *not* just pointers to structs). > > However, it was just an oversight of this developer when converting > Python code to C code in 6d297f8 (Status update on merge-recursive in > C, 2006-07-08) which introduced such a return type. > > Besides, by converting this construct to pass in the struct, we can now > start returning a value that can indicate errors in future patches. This > will help the current effort to libify merge-recursive.c. I do not think returning a small struct by value is unconditionally a bad thing, but I do agree with you that this change makes the resulting code much easier to read, especially once this starts returning errors. Good.