Had to check a few warnings earlier and there hasn't been a warning report in a while, thought I'd share it. It's also still impossible to configure with -Werror because of warnings in configure scripts.
Wine version wine-1.3.22-203-gac90c1b ac90c1bd1878599710605fa5b4e2fe8ce224b280
Enabled packages alsa freetype gstreamer jpeg ldap openal opengl openssl png x xinerama xinput2 xml xrandr
Disabled packages capi cms cups curses esd fontconfig gettextpo gnutls gphoto gsm hal jack mpg123 nas opencl oss sane tiff v4l xslt xxf86vm
CFLAGS -msse4 -O3 -Wall
Built on Linux azura 3.0-0-generic #1-Ubuntu SMP Thu Jun 9 16:32:10 UTC 2011 x86_64 x86_64 x86_64 GNU/Linux
J. Leclanche
../../../../dlls/gdiplus/tests/image.c: In function ‘test_palette’: ../../../../dlls/gdiplus/tests/image.c:1773:104: warning: array subscript is above array bounds [-Warray-bounds]
This is because the ColorPalette structure has an array of length 1 at the end, which is really a variable-length array. We'd need a way to let gcc know of this fact, without breaking compatibility with Windows headers that declare it as an array of length 1.
On Sat, Jun 18, 2011 at 9:55 AM, Jerome Leclanche adys.wh@gmail.com wrote:
Had to check a few warnings earlier and there hasn't been a warning report in a while, thought I'd share it. It's also still impossible to configure with -Werror because of warnings in configure scripts.
Wine version wine-1.3.22-203-gac90c1b ac90c1bd1878599710605fa5b4e2fe8ce224b280
Enabled packages alsa freetype gstreamer jpeg ldap openal opengl openssl png x xinerama xinput2 xml xrandr
Disabled packages capi cms cups curses esd fontconfig gettextpo gnutls gphoto gsm hal jack mpg123 nas opencl oss sane tiff v4l xslt xxf86vm
CFLAGS -msse4 -O3 -Wall
Built on Linux azura 3.0-0-generic #1-Ubuntu SMP Thu Jun 9 16:32:10 UTC 2011 x86_64 x86_64 x86_64 GNU/Linux
J. Leclanche
../../../dlls/netapi32/nbt.c:580:30: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
This is a false positive. h_addr_list is declared as a char **, and technically it is, but gethostbyname only returns IPv4 addresses, i.e. ones that can fit in a DWORD. --Juan
On Tue, Jun 28, 2011 at 12:51:02PM -0700, Juan Lang wrote:
../../../dlls/netapi32/nbt.c:580:30: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
This is a false positive. h_addr_list is declared as a char **, and technically it is, but gethostbyname only returns IPv4 addresses, i.e. ones that can fit in a DWORD.
That doesn't sound like a problem that would give that warning.
David
This is a false positive. h_addr_list is declared as a char **, and technically it is, but gethostbyname only returns IPv4 addresses, i.e. ones that can fit in a DWORD.
That doesn't sound like a problem that would give that warning.
Why not? A cast of a pointer to a DWORD with 64-bit pointers would cause truncation, if it were indeed a pointer that were being cast. It isn't, even though it's declared that way. --Juan
On Tue, Jun 28, 2011 at 03:18:47PM -0700, Juan Lang wrote:
This is a false positive. ?h_addr_list is declared as a char **, and technically it is, but gethostbyname only returns IPv4 addresses, i.e. ones that can fit in a DWORD.
That doesn't sound like a problem that would give that warning.
Why not? A cast of a pointer to a DWORD with 64-bit pointers would cause truncation, if it were indeed a pointer that were being cast. It isn't, even though it's declared that way.
But 'char **h_addr_list;' is a pointer to an array of pointers to address buffers (defined as char) - not a pointer to an array of addresses. IIRC the 'something' will be an IPv4 address - which might be held as a 32 bit quantity rather that an array of char. But nowhere should you cast the 32bit int (DWORD) to/from a pointer type.
David
On Wed, 29 Jun 2011 08:31:58 +0100, David Laight wrote:
On Tue, Jun 28, 2011 at 03:18:47PM -0700, Juan Lang wrote:
This is a false positive. ?h_addr_list is declared as a char **,
and
technically it is, but gethostbyname only returns IPv4 addresses,
i.e.
ones that can fit in a DWORD.
That doesn't sound like a problem that would give that warning.
Why not? A cast of a pointer to a DWORD with 64-bit pointers would cause truncation, if it were indeed a pointer that were being cast. It isn't, even though it's declared that way.
But 'char **h_addr_list;' is a pointer to an array of pointers to address buffers (defined as char) - not a pointer to an array of addresses. IIRC the 'something' will be an IPv4 address - which might be held as a 32 bit quantity rather that an array of char. But nowhere should you cast the 32bit int (DWORD) to/from a pointer type.
David is right, the address is not stored as a pointer but as a DWORD in place of the chars. Like this:
gethostbyname("winehq.org"): wrong: (DWORD) host->h_addr_list[i] = 0x00cbd1c8 = 200.209.203.0 right: *(DWORD*) host->h_addr_list[i] = 0x86192ed1 = 209.46.25.134
David is right, the address is not stored as a pointer but as a DWORD in place of the chars. Like this:
gethostbyname("winehq.org"): wrong: (DWORD) host->h_addr_list[i] = 0x00cbd1c8 = 200.209.203.0 right: *(DWORD*) host->h_addr_list[i] = 0x86192ed1 = 209.46.25.134
Patch welcome ;) --Juan