On Thu, 15 Dec 2016, Eduard Rozenberg wrote:
>
> In case it?s useful, here are several warnings that were generated
> on my Linux compile on Slackware 14.1 kernel 3.10.17.
>
>...
>
> gcc -DHAVE_CONFIG_H -I. -I../..  -I../../smtpd -I../../openbsd-compat -I. 
> -I/usr/include  -DSMTPD_CONFDIR=\"/etc/opensmtpd\" 
> -DPATH_CHROOT=\"/var/empty\" -DPATH_SMTPCTL=\"/usr/sbin/smtpctl\" 
> -DPATH_MAILLOCAL=\"/usr/libexec/opensmtpd/mail.local\" 
> -DPATH_LIBEXEC=\"/usr/libexec/opensmtpd\" -DHAVE_CONFIG_H -DNO_IO 
> -DPATH_GZCAT=\"/usr/bin/zcat\" 
> -DPATH_ENCRYPT=\"/usr/libexec/opensmtpd/encrypt\" -O2 -fPIC -fstack-protector 
>  -fPIC -DPIC -Wall -Wpointer-arith -Wuninitialized -Wsign-compare 
> -Wformat-security -Wsizeof-pointer-memaccess -Wno-pointer-sign 
> -Wno-unused-result -fno-strict-aliasing -fno-builtin-memset -D_BSD_SOURCE  
> -D_GNU_SOURCE -c -o ../../smtpd/smtpctl-parser.o `test -f 
> '../../smtpd/parser.c' || echo './'`../../smtpd/parser.c
> ../../smtpd/parser.c:123:1: warning: 'cmd_dump' defined but not used 
> [-Wunused-function]
>  cmd_dump(struct node *node, int depth)
>  ^

This last warning looks like cmd_dump is leftover debug code in parser.c

One way of keeping it but hiding it is to use #if 0 and #endif as in this
patch:

--- smtpd/parser.c.orig 2016-10-12 00:16:24.000000000 -0700
+++ smtpd/parser.c      2016-12-17 07:02:29.615776601 -0800
@@ -119,6 +119,7 @@
        return (n);
 }

+#if 0
 static void
 cmd_dump(struct node *node, int depth)
 {
@@ -132,6 +133,7 @@
        TAILQ_FOREACH(n, &node->children, entry)
                cmd_dump(n, depth + 1);
 }
+#endif

 static int
 cmd_check(const char *str, struct node *node, struct parameter *res)

----------------------------------------------------------------------
-Richard Narron

-- 
You received this mail because you are subscribed to [email protected]
To unsubscribe, send a mail to: [email protected]

Reply via email to