bug-gnulib
[Top][All Lists]
Advanced

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

Re: socklen_t


From: Stepan Kasal
Subject: Re: socklen_t
Date: Mon, 12 Sep 2005 14:19:24 +0200
User-agent: Mutt/1.4.1i

Hello,

On Thu, Sep 01, 2005 at 04:43:30AM -0500, Albert Chin wrote:
>          for arg2 in "struct sockaddr" void; do
>             for t in int size_t unsigned long "unsigned long"; do
>                AC_TRY_COMPILE([
>                   #include <sys/types.h>
>                   #include <sys/socket.h>
> 
>                   int getpeername (int, $arg2 *, $t *);
>                ],[
>                   $t len;
>                   getpeername(0,0,&len);
>                ],[
>                   socklen_t_equiv="$t"
>                   break
>                ])
>             done
>          done

I see two problems with this code:

1) Wouldn't "break 2" be more appropriate?

2) The use of `break' or `continue' inside `AC_*_IFELSE' (or the obsolete
   AC_TRY_*) is not safe; it skips the cleanup of that macro.
   Something like this is better:

                ...
                ],[
                   socklen_t_equiv="$t"
                ])
             done
             test -z "$socklen_t_equiv" && break
          done

          if -z "$socklen_t_equiv"; then
             AC_MSG_ERROR([Cannot find a type to use in place of socklen_t])
          fi

Have a nice day,
        Stepan Kasal




reply via email to

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