[nsd-users] remove unnecessary declarations

W.C.A. Wijngaards wouter at nlnetlabs.nl
Fri Oct 21 07:05:47 UTC 2016


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Hi Jan,

Yes, that is the case.  That is for portability.

If it somehow a problem on systems, it would receive #ifdefs around
it, but it does not seem to give warnings.

Best regards, Wouter

On 20/10/16 22:11, Jan Stary wrote:
> The following source files in the 4.1.3 tarball declare extern int
> optind and extern char* optarg, but those are already declared in
> the headers. (Or is there a system where this is not the case?)
> 
> Jan
> 
> diff -Nup -Nupr /tmp/nsd-4.1.13/nsd-checkconf.c
> /home/hans/src/nsd-4.1.13/nsd-checkconf.c ---
> /tmp/nsd-4.1.13/nsd-checkconf.c	Fri Aug  5 16:04:30 2016 +++
> /home/hans/src/nsd-4.1.13/nsd-checkconf.c	Thu Oct 20 21:59:47 2016 
> @@ -18,9 +18,6 @@ #include "dname.h" #include "rrl.h"
> 
> -extern char *optarg; -extern int optind; - #define
> ZONE_GET_ACL(NAME, VAR, PATTERN) 		\ if (strcasecmp(#NAME, (VAR))
> == 0) { 	\ quote_acl(PATTERN->NAME); 	\ diff -Nup -Nupr
> /tmp/nsd-4.1.13/nsd-checkzone.c
> /home/hans/src/nsd-4.1.13/nsd-checkzone.c ---
> /tmp/nsd-4.1.13/nsd-checkzone.c	Wed May 28 08:51:23 2014 +++
> /home/hans/src/nsd-4.1.13/nsd-checkzone.c	Thu Oct 20 22:00:24 2016 
> @@ -98,9 +98,6 @@ void sig_handler(int ATTR_UNUSED(sig)) { }
> 
> -extern char *optarg; -extern int optind; - int main(int argc, char
> *argv[]) { diff -Nup -Nupr /tmp/nsd-4.1.13/nsd-control.c
> /home/hans/src/nsd-4.1.13/nsd-control.c ---
> /tmp/nsd-4.1.13/nsd-control.c	Thu Sep 15 14:03:54 2016 +++
> /home/hans/src/nsd-4.1.13/nsd-control.c	Thu Oct 20 21:55:46 2016 @@
> -350,11 +350,6 @@ go(const char* cfgfile, char* svr, int argc,
> char* arg return ret; }
> 
> -/** getopt global, in case header files fail to declare it. */ 
> -extern int optind; -/** getopt global, in case header files fail
> to declare it. */ -extern char* optarg; - /** Main routine for
> nsd-control */ int main(int argc, char* argv[]) { diff -Nup -Nupr
> /tmp/nsd-4.1.13/nsd-mem.c /home/hans/src/nsd-4.1.13/nsd-mem.c ---
> /tmp/nsd-4.1.13/nsd-mem.c	Tue Aug 16 10:23:14 2016 +++
> /home/hans/src/nsd-4.1.13/nsd-mem.c	Thu Oct 20 22:02:52 2016 @@
> -282,9 +282,6 @@ void sig_handler(int ATTR_UNUSED(sig)) { }
> 
> -extern char *optarg; -extern int optind; - int main(int argc, char
> *argv[]) { diff -Nup -Nupr /tmp/nsd-4.1.13/nsd.c
> /home/hans/src/nsd-4.1.13/nsd.c --- /tmp/nsd-4.1.13/nsd.c	Tue May
> 31 15:53:47 2016 +++ /home/hans/src/nsd-4.1.13/nsd.c	Thu Oct 20
> 21:54:05 2016 @@ -411,9 +411,6 @@ bind8_stats (struct nsd *nsd) } 
> #endif /* BIND8_STATS */
> 
> -extern char *optarg; -extern int optind; - int main(int argc, char
> *argv[]) { _______________________________________________ 
> nsd-users mailing list nsd-users at NLnetLabs.nl 
> https://open.nlnetlabs.nl/mailman/listinfo/nsd-users
> 

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQIcBAEBCAAGBQJYCb5LAAoJEJ9vHC1+BF+NGPEP/AjTWDtMw2AhvMQs9PQuHlxv
4z9zbOJ9xP+CfKVvqGN7QjCQ6oHfsvMgBycWBtWl7uZgJI3e4gHYtPJJ3f4oixR9
IcHoTQ8hLwqyDAZESc4nXd6qtzEcORKsRDmgXq5qZgPzv/A1nkRemHAiQMvrO/zr
tELQR3SQpR5GJlgmCefrikGQFmAYzKalWQ9429M2s5xwPcJ4GMT0glhhHXANhQsh
yxmPykwuFeblVCnzWxy5zT+OU1V+graO/Ip5fh9qyDVBOgMHxP7Btcw5Hlq9Zray
wYUquIthZEUfAk7YWwaLN/6YFn3/c7pXHlBirD7gUAlHUJQjAuKW/lMZkPpcQQXu
5I8/dFd+xlXorTtFUJfO6ZsrAWIVnhRKxojQNL+1ld6OKn/O15BGCGPalnE1S36f
WI5NIKzsf+Cay4xreUuWzseSBee3pPnJYRzx+4MNMhN0RGUMX8Ndxe7PfcTgvW2b
MpD/oNETVChqFjy0tVjydalZ3rvNaNjX02qwH6o/KSHDREE3MAMYsbuI6ff4uOls
+SNyrd5jzhNdZFP1keaBO/GlPxwiXtz5+HciMTrfWh/4AxWQ07uMMKWH4PPmhRgA
rUCkKxC7qQs4KWlhtA6Sejvmx93EL+q82Z2DbxiHTyNKnaxb7DiEDAPG23JQoyKH
3Z6IoTgM4a4Z4JNOY+55
=RSHL
-----END PGP SIGNATURE-----



More information about the nsd-users mailing list