Re: [PATCH 21/21] config: fix sign comparison warnings
- From
Patrick Steinhardt <ps@pks.im>
- Date
- Jul 23, 2025, 13:38 UTC
- Message-ID
- <aIDl0tiAmBrQU8Ql@pks.im>
- In-Reply-To
- <2b914b60-3417-4a49-b545-3109c9a05257@gmail.com>
On Wed, Jul 23, 2025 at 10:38:16AM +0100, Phillip Wood wrote:
Show 17 quoted lines
> Hi Patrick
>
> On 17/07/2025 11:49, Patrick Steinhardt wrote:
> > There are a couple of -Wsign-compare warnings in "config.c":
> >
> > - `prepare_include_condition_pattern()` is declared to return a signed
> > int, but it either returns 0 or the index of the last dir separator
> > in a path.
>
> That is not correct, the function contains the lines
>
> if (!kvi || !kvi->path)
> return error(_("relative config include "
> "conditionals must come from
> files"));
>
> so a negative return value is possible.Oh dear, I totally missed this one. Good catch, will fix in the next version of this series. Thanks!
Patrick