Re: [RFC][PATCH] t-prio-queue: simplify using compound literals

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

 



On Mon, Apr 08, 2024 at 09:57:41AM -0700, Junio C Hamano wrote:

> Jeff King <peff@xxxxxxxx> writes:
> 
> >> We should still be hesitant against the practice to the same degree
> >> that we are hesitant against struct assignment, especially when the
> >> struct is of nontrivial size, or the struct has a pointer member
> >> whose memory ownership semantics goes against shallow copying of the
> >> struct.
> >
> > Good point. There are really two thresholds: is this something that
> > should be totally forbidden, and is this something that is generally a
> > good idea. I think the answers here are "no" and "yes" respectively.
> 
> I agree with your conclusion but I found the above a bit confusing.
> 
> Between "totally horrible, do not even think about it" (0%) and
> "that is of course an excellent idea" (100%), you want to have two
> points "might have some merit but not acceptable" (33%) and
> something else that is less than "of course an excellent idea" but
> still acceptable (66%)?  I would not phrase the last threshold "is
> generally a good idea", though.  "It is not generally a good idea,
> but in this case, it is an adequate solution", maybe.

Sorry, yes, I flipped the boolean on the second one. I should have said
"is it forbidden" and "is it generally a bad idea", in which case the
answers are "no" and "yes".

Or if you prefer, as I stated it, the answers to both are "no". ;)

I.e., it is OK to use here but it is not something we should be doing
all the time. Sorry for the confusion.

-Peff




[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]

  Powered by Linux