[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [libvirt] PATCH: 16/25: Fix GNULIB warnings on Mingw



"Daniel P. Berrange" <berrange redhat com> wrote:
> The GNULIB Makefile.am doesn't set any particular compiler warning
> flags in the belief that upstream GNULIB developers sort out all
> warnings before committing their code. This is reasonable for builds
> on mainstream Linux platforms, but MinGW builds of GNULIB don't
> have nearly the same level of testing. So This patch adds the libvirt
> $(WARN_CFLAGS) to the gnulib Makefile.am and then fixes the problems
> this showed up. Nothing of consequence really. Leave it upto gnulib
> developers whether its worth fixing these.
>
>  Makefile.am    |    2
>  gettimeofday.c |    5 +-
>  ioctl.c        |    1
>  poll.c         |    4 -
>  strerror.c     |  128 ++++++++++++++++++++++++++++-----------------------------

I've dealt with the poll.c problems upstream.
1) Your patch to remove unused var decls
2) added a pragma to avoid the warning about the unsigned_var < 0 tests

All of this looks fine to commit here.
I've posted an adjusted strerror.c change upstream,
without so many casts.

Dan, what warning does the ioctl one fix?
Same for gettimeofday.
Then I'll take care of those, too.


> diff --git a/gnulib/lib/Makefile.am b/gnulib/lib/Makefile.am
> --- a/gnulib/lib/Makefile.am
> +++ b/gnulib/lib/Makefile.am
> @@ -26,7 +26,7 @@ DISTCLEANFILES =
>  DISTCLEANFILES =
>  MAINTAINERCLEANFILES =
>
> -AM_CPPFLAGS =
> +AM_CPPFLAGS = $(WARN_CFLAGS)
>
>  noinst_LTLIBRARIES += libgnu.la
>
> diff --git a/gnulib/lib/gettimeofday.c b/gnulib/lib/gettimeofday.c
> --- a/gnulib/lib/gettimeofday.c
> +++ b/gnulib/lib/gettimeofday.c
> @@ -47,11 +47,12 @@ static struct tm *localtime_buffer_addr
>     On the first call, record the address of the static buffer that
>     localtime uses for its result.  */
>
> +#undef localtime
> +extern struct tm *localtime (time_t const *);
> +
>  struct tm *
>  rpl_localtime (time_t const *timep)
>  {
> -#undef localtime
> -  extern struct tm *localtime (time_t const *);
>    struct tm *tm = localtime (timep);
>
>    if (localtime_buffer_addr == &tm_zero_buffer)
> diff --git a/gnulib/lib/ioctl.c b/gnulib/lib/ioctl.c
> --- a/gnulib/lib/ioctl.c
> +++ b/gnulib/lib/ioctl.c
> @@ -24,6 +24,7 @@
>  #define WIN32_LEAN_AND_MEAN
>  /* Get winsock2.h. */
>  #include <sys/socket.h>
> +#include <sys/ioctl.h>
>
>  /* Get set_winsock_errno, FD_TO_SOCKET etc. */
>  #include "w32sock.h"


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]