Re: [PATCH v4 1/4] i18n: factorize more 'incompatible options' messages
- From
Johannes Sixt <j6t@kdbg.org>
- Date
- Feb 1, 2022, 07:01 UTC
- Message-ID
- <f8202cc7-be5c-5efa-2a3b-987114356c6b@kdbg.org>
- In-Reply-To
- <xmqqv8xzh6iw.fsf@gitster.g>
Am 31.01.22 um 23:41 schrieb Junio C Hamano:
Show 25 quoted lines
> "Jean-Noël Avila via GitGitGadget" <gitgitgadget@gmail.com> writes:
>
>> +inline void die_for_incompatible_opt3(int opt1, const char *opt1_name,
>> + int opt2, const char *opt2_name,
>> + int opt3, const char *opt3_name)
>> +{
>> + die_for_incompatible_opt4(opt1, opt1_name,
>> + opt2, opt2_name,
>> + opt3, opt3_name,
>> + 0, "");
>> +}
>
> I haven't seen a non-static inline function defined in a common
> header files. Does this actually work? In my build, ld choked on
> this one.
>
> Otherwise make it "static inline"? Or just
>
> #define die_for_incompatible_opt3(o1,n1,o2,n2,o3,n3) \
> die_for_incompatible_opt4((o1), (n1), \
> (o2), (n2), \
> (o3), (n3), \
> 0, "")
>
> perhaps?Please no macros where they are not a clear advantage. Make it a function, either static inline, or out-of-line (the latter would be my personal preference in this case because the function is not called in a hot path).
-- Hannes