Re: [PATCH] ws2_32/tests: Fix compilation warning
Fabian Maurer <dark.shadow4(a)web.de> writes:
Without that change, gcc gives the warning "include/winsock.h:480:37: ‘readfds.fd_array[__i]’ may be used uninitialized in this function"
It looks initialized to me. What gcc version is that? -- Alexandre Julliard julliard(a)winehq.org
It looks initialized to me. What gcc version is that?
gcc version 7.2.0, running on latest Arch Linux. I'm compiling with -Werror, that's how I noticed. Complete error:
In file included from ../../../../wine-git/include/winsock2.h:47:0, from ../../../../wine-git/dlls/ws2_32/tests/sock.c:25: ../../../../wine-git/dlls/ws2_32/tests/sock.c: In function ‘SelectReadThread’: ../../../../wine-git/include/winsock.h:480:37: error: ‘readfds.fd_array[__i]’ may be used uninitialized in this function [- Werror=maybe-uninitialized] if (((cast*)(set))->fd_array[__i]==(fd)) \
Regards, Fabian Maurer
Fabian Maurer <dark.shadow4(a)web.de> writes:
It looks initialized to me. What gcc version is that?
gcc version 7.2.0, running on latest Arch Linux. I'm compiling with -Werror, that's how I noticed.
I don't get any warnings on Debian with gcc 7.2.0. -- Alexandre Julliard julliard(a)winehq.org
Fabian Maurer <dark.shadow4(a)web.de> writes:
I don't get any warnings on Debian with gcc 7.2.0.
Happens to be when using
CFLAGS="-Werror" ./configure
Without -Werror I don't even get a warning for some reason though.
Running configure with -Werror is a bad idea, it will screw up check results. You should pass it to make but not configure. -- Alexandre Julliard julliard(a)winehq.org
Alexandre Julliard <julliard(a)winehq.org> writes:
Fabian Maurer <dark.shadow4(a)web.de> writes:
I don't get any warnings on Debian with gcc 7.2.0.
Happens to be when using
CFLAGS="-Werror" ./configure
Without -Werror I don't even get a warning for some reason though.
Running configure with -Werror is a bad idea, it will screw up check results. You should pass it to make but not configure.
Note that in this case, the warning is most likely because by passing such CFLAGS you are disabling optimizations, which probably causes gcc to not track the code flow correctly. -- Alexandre Julliard julliard(a)winehq.org
I see, thank you. Regards, Fabian Maurer
participants (2)
-
Alexandre Julliard -
Fabian Maurer