diff options
author | Ga?l PORTAY <gael.portay@gmail.com> | 2015-05-02 13:33:34 +0200 |
---|---|---|
committer | Ga?l PORTAY <gael.portay@gmail.com> | 2015-05-02 13:33:34 +0200 |
commit | fec61eb750846525fb074f557ea01b9208e697df (patch) | |
tree | a14ba7ac06d9786222976b02092c40a75558860c /configure.ac | |
parent | 116237a9098abbf8823ef52abeb26387c3a59436 (diff) | |
download | dropbear-fec61eb750846525fb074f557ea01b9208e697df.tar.gz |
Test struct existance against sizeof() operator
Instead of declaring an "unused-variable" or "unused-but-set-variable"
structure.
This avoid unexpected broken configurations when using something like:
$ ./configure CFLAGS="-Wall -Wextra -Werror"
It causes AC_COMPILE_IFELSE to fail and thus leading to a mismatch
configuration (because the CFLAGS are passed to the macro).
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/configure.ac b/configure.ac index b0e85e5..6ae8c32 100644 --- a/configure.ac +++ b/configure.ac @@ -265,7 +265,7 @@ AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage #include <sys/types.h> #include <sys/socket.h> ]], - [[ struct sockaddr_storage s; ]])], + [[ if (sizeof(struct sockaddr_storage)) return 0 ]])], [ ac_cv_have_struct_sockaddr_storage="yes" ], [ ac_cv_have_struct_sockaddr_storage="no" ] ) @@ -279,7 +279,7 @@ AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [ #include <sys/types.h> #include <netinet/in.h> ]], - [[ struct sockaddr_in6 s; s.sin6_family = 0; ]])], + [[ if (sizeof(struct sockaddr_in6)) return 0 ]])], [ ac_cv_have_struct_sockaddr_in6="yes" ], [ ac_cv_have_struct_sockaddr_in6="no" ] ) @@ -293,7 +293,7 @@ AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [ #include <sys/types.h> #include <netinet/in.h> ]], - [[ struct in6_addr s; s.s6_addr[0] = 0; ]])], + [[ if (sizeof(struct in6_addr)) return 0 ]])], [ ac_cv_have_struct_in6_addr="yes" ], [ ac_cv_have_struct_in6_addr="no" ] ) @@ -308,7 +308,7 @@ AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [ #include <sys/socket.h> #include <netdb.h> ]], - [[ struct addrinfo s; s.ai_flags = AI_PASSIVE; ]])], + [[ if (sizeof(struct addrinfo)) return 0 ]])], [ ac_cv_have_struct_addrinfo="yes" ], [ ac_cv_have_struct_addrinfo="no" ] ) |