gcc 4.6 warning report

David Laight david at l8s.co.uk
Wed Jun 29 02:31:58 CDT 2011

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 Laight: david at l8s.co.uk

More information about the wine-devel mailing list