This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
Re: [patch] Fix compiler warnings throughout
Hi Eric,
thanks for reviewing!
On Aug 8 05:38, Eric Blake wrote:
> On 08/08/2012 05:04 AM, Corinna Vinschen wrote:
> > Index: libc/posix/collate.c
> > [...]
> > - dest_str = malloc(dest_len = delta);
> > + dest_str = (u_char *) malloc(dest_len = delta);
>
> Is this one necessary? I can see why you added the other casts, though.
Even if it's not required, the cast certainly doesn't hurt either,
does it?
> > @@ -364,6 +364,9 @@ sopno stopst;
> > char *ssp; /* start of string matched by subsubRE */
> > char *sep; /* end of string matched by subsubRE */
> > char *oldssp; /* previous ssp */
> > +/* dp is only used for assertion testing which, for some reason, is not
> > + recognized as usage. */
> > +#pragma GCC diagnostic ignored "-Wunused-but-set-variable"
>
> Does this need to be guarded by a minimum gcc version filter?
> [...]
> > Index: libc/string/strcasestr.c
> > ===================================================================
> > RCS file: /cvs/src/src/newlib/libc/string/strcasestr.c,v
> > retrieving revision 1.4
> > diff -u -p -r1.4 strcasestr.c
> > --- libc/string/strcasestr.c 19 Aug 2011 16:58:20 -0000 1.4
> > +++ libc/string/strcasestr.c 8 Aug 2012 11:01:28 -0000
> > @@ -84,6 +84,8 @@ QUICKREF
> > (!memchr ((h) + (h_l), '\0', (j) + (n_l) - (h_l)) \
> > && ((h_l) = (j) + (n_l)))
> > # define CANON_ELEMENT(c) tolower (c)
> > +/* strncasecmp uses signed char, CMP_FUNC is expected to use unsigned char. */
> > +#pragma GCC diagnostic ignored "-Wpointer-sign"
>
> Another case of guarding with a gcc version guard.
Would you mind to prepare a patch?
> Everything else seemed decent on inspection.
Thanks,
Corinna
--
Corinna Vinschen
Cygwin Project Co-Leader
Red Hat