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))
I also have this with the same toolchain:
../../lib/gettext.h:79: warning: '__gnu_inline__' attribute directive ignored
(and same for lines 88 and 98).
Context:
62 /* Disabled NLS. */
63 # if defined __GNUC__ && !defined __clang__ && !defined __cplusplus
64 /* Use inline functions, to avoid warnings
65 warning: format not a string literal and no format arguments
66 that don't occur with enabled NLS. */
67 /* The return type 'const char *' serves the purpose of
producing warnings
68 for invalid uses of the value returned from these functions. */
69 # if __GNUC__ >= 9
70 # pragma GCC diagnostic push
71 # pragma GCC diagnostic ignored "-Wbuiltin-declaration-mismatch"
72 # endif
73 __attribute__ ((__always_inline__, __gnu_inline__)) extern inline
74 # if !defined(__sun)
75 const
76 # endif
77 char *
78 gettext (const char *msgid)
- Orgad