Re: [PATCH 2/3] ci: add build checking for side-effects in assert() calls
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Mar 17, 2025, 22:27 UTC
- Message-ID
- <xmqqo6xz70oh.fsf@gitster.g>
- In-Reply-To
- <CABPp-BF1LgdafW+PHmttuhHL1OOHPTsGpOTVuG_A0SSH5cbfbg@mail.gmail.com>
Elijah Newren <newren@gmail.com> writes:
Show 11 quoted lines
>> >> +extern int not_supposed_to_survive; >> >> +#define assert(expr) ((void)(not_supposed_to_survive || (expr))) >> > >> > , which serve as the core trick, I had used elsewhere before. >> >> It may be arguable that it is too small to be copyrightable and >> there is no other way to express the idea behind that check, but >> in any case ... > > That's what I had been assuming, but then you, brian, and Taylor all > pointed out how clever it was making me think otherwise.
Heh, cleverness lies in the idea, not the expression, and copyright is about expression.
> Turns out we don't need an alternative. I contacted the author, who > responded and placed the two-liner into the public domain with no > warranty of any kind. I'll send a re-roll with an updated commit > message.
Wonderful. That is the best solution.
Thanks.