Compile user program and resolver

Kevin Darcy kcd at daimlerchrysler.com
Sat Jun 10 00:00:09 UTC 2000


The __P() macro is defined in lib/isc/eventlib.h. Basically, it's just a
litmus test for whether your compiler is ANSI or not: if it is, then it
passes through the function prototype as is, otherwise it elides the
arguments.

Strangely, Solaris 7, which ships with a BIND 8 implementation, includes
the __P() macro right in  /usr/include/resolv.h. But in the BIND
distribution, the macro definition is dislocated. Did Sun perhaps "fix" an
ISC oversight?

As for "invalid exception specifications", I have no idea since I don't use
gcc...


- Kevin

Cory Spitz wrote:

> All,
> I am attempting to compile a simple c program on Red Hat Linux 6.1,
> kernel 2.2.12-20.  This is what I have:
>
> $ gcc -I/usr/local/bind/include -c testprogram.c
> In file included from testprogram.c:5:
> /usr/local/bind/include/resolv.h:119: invalid exception specifications
> /usr/local/bind/include/resolv.h:126: invalid exception specifications
>
> This is what that resolv.h file looks like:
>     114 typedef res_sendhookact (*res_send_qhook)__P((struct sockaddr_in
> * const *ns,
>     115                                               const u_char
> **query,
>     116                                               int *querylen,
>     117                                               u_char *ans,
>     118                                               int anssiz,
>     119                                               int *resplen));
>     120
>     121 typedef res_sendhookact (*res_send_rhook)__P((const struct
> sockaddr_in *ns,
>     122                                               const u_char
> *query,
>     123                                               int querylen,
>     124                                               u_char *ans,
>     125                                               int anssiz,
>     126                                               int *resplen));
>
> I don't understand these typedef's, I don't understand the "__P"
> business, and I don't understand the compiler error.  Can anyone tell me
> what these mean, and if I can safely comment these out in resolv.h???
>
> Thanks,
> -Cory Spitz









More information about the bind-users mailing list