bug-gnulib
[Top][All Lists]
Advanced

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

Re: Incorrect detection of member sa_len.


From: Ralf Wildenhues
Subject: Re: Incorrect detection of member sa_len.
Date: Sun, 10 Apr 2011 09:24:20 +0200
User-agent: Mutt/1.5.20 (2010-08-04)

Hello,

* Mats E Andersson wrote on Sat, Apr 09, 2011 at 02:23:27PM CEST:
> the m4 helper in `m4/getaddrinfo.m4` is incorrectly implementing
> a test whether `struct sockaddr` contains a member `sa_len`.
> 
> Any BSD system must include `<sys/types.h>` in order for the test
> code to deliver a trustworthy answer. As always this header must
> precede `<sys/socket.h>` on any BSD system.

The test should be using AC_INCLUDES_DEFAULT, no?  That takes care of
sys/types.h:

AC_CHECK_MEMBERS([struct sockaddr.sa_len], , ,
  [AC_INCLUDES_DEFAULT
   [#include <sys/socket.h>
  ]])

Thanks,
Ralf

> --- a/m4/getaddrinfo.m4
> +++ b/m4/getaddrinfo.m4
> @@ -105,7 +105,9 @@ AC_DEFUN([gl_PREREQ_GETADDRINFO], [
>  
>    dnl Including sys/socket.h is wrong for Windows, but Windows does not
>    dnl have sa_len so the result is correct anyway.
> -  AC_CHECK_MEMBERS([struct sockaddr.sa_len], , , [#include <sys/socket.h>])
> +  AC_CHECK_MEMBERS([struct sockaddr.sa_len], , , [
> +#include <sys/types.h>
> +#include <sys/socket.h>])
>  
>    AC_CHECK_HEADERS_ONCE([netinet/in.h])



reply via email to

[Prev in Thread] Current Thread [Next in Thread]