On Sun, Sep 14, 2025 at 7:14 AM Orgad Shaneh <[email protected]> wrote:
>
> On Sat, Sep 13, 2025 at 1:44 AM Collin Funk <[email protected]> wrote:
> >
> > Hi Orgad,
> >
> > Orgad Shaneh <[email protected]> writes:
> >
> > > On Fri, Sep 12, 2025 at 10:54 AM Paul Eggert <[email protected]> wrote:
> > >>
> > >> On 2025-09-11 22:34, Bruno Haible via Gnulib discussion list wrote:
> > >> > What would be the point of this change? What does this fix or improve?
> > >>
> > >> I have the same question.
> > >>
> > >> More generally, many parts of Gnulib use a signed type (typically idx_t)
> > >> for object sizes, so that arithmetic is less confusing and so that
> > >> arithmetic overflow can be detected automatically. Using int, for sizes
> > >> that fit into int, follows this practice.
> > >
> > > Hi Bruno and Paul,
> > >
> > > Thanks for your feedback. I understand the patch is not needed, and
> > > I'll call it off.
> > >
> > > It was originally done by a colleague who couldn't recall the specific
> > > reason for it, though it might have been an attempt to suppress a
> > > compiler warning.
> > >
> > > I've checked with all our toolchains, and none showed such a warning.
> > >
> > > Sorry for the noise.
> > > - Orgad
> >
> > For future reference there is compiler warnings listed in the HACKING
> > of Gnulib's root directory for GCC 15 and Clang 20.
> >
> > These will disable some warnings that Gnulib does not care about, and
> > some ones that are enabled by -Wall -Wextra.
> >
> > We typically silence false positives for those versions, but ignore them
> > for older versions. Since it is a bit too difficult for us to track
> > every compiler bug. :)
> >
> > Thanks,
> > Collin
>
> Hi,
>
> I found the warning now:
> ../../lib/malloca.c:61: warning: comparison is always false due to
> limited range of data type
>
> Context:
>      59   int plus = sizeof (small_t) + alignment2_mask;
>      60   idx_t nplus;
>      61   if (!ckd_add (&nplus, n, plus) && !xalloc_oversized (nplus, 1))

This warning was introduced by 7e605302f7 (malloca: avoid ptrdiff_t overflow).

The compiler is gcc 4.1.2, mips64-octeon-linux-gnu host.

- Orgad

Reply via email to