Re: gcc 4.6 warning report

2011-06-30 Thread Juan Lang
> 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 ;) --Ju

Re: gcc 4.6 warning report

2011-06-29 Thread Lauri Kenttä
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.

Re: gcc 4.6 warning report

2011-06-29 Thread David Laight
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 gi

Re: gcc 4.6 warning report

2011-06-28 Thread Juan Lang
>> 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-bi

Re: gcc 4.6 warning report

2011-06-28 Thread David Laight
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 r

Re: gcc 4.6 warning report

2011-06-28 Thread Juan Lang
../../../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

Re: gcc 4.6 warning report

2011-06-28 Thread Vincent Povirk
> ../../../../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-len