Subject: pkg/33634: net/trafshow build fails w/GCC4, MacOS X 10.4.6
To: None <pkg-manager@netbsd.org, gnats-admin@netbsd.org,>
From: None <jdbaker@mylinuxisp.com>
List: pkgsrc-bugs
Date: 06/02/2006 18:05:00
>Number:         33634
>Category:       pkg
>Synopsis:       net/trafshow build fails w/GCC4, MacOS X 10.4.6
>Confidential:   no
>Severity:       non-critical
>Priority:       high
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Jun 02 18:05:00 +0000 2006
>Originator:     John D. Baker
>Release:        MacOS X 10.4.6, pkgsrc-current
>Organization:
>Environment:
Darwin alphonse.local 8.6.0 Darwin Kernel Version 8.6.0: Tue Mar  7 16:58:48 PST 2006; root:xnu-792.6.70.obj~1/RELEASE_PPC Power Macintosh powerpc

>Description:
Building net/trafshow fails as follows on systems using GCC4:

gcc -pipe -O2 -I/usr/include -Wall -I. -DHAVE_CONFIG_H  -D_REENTRANT -c screen.c
screen.c:154: error: static declaration of 'curs_dock_x' follows non-static declaration
screen.c:44: error: previous declaration of 'curs_dock_x' was here
screen.c:154: error: static declaration of 'curs_dock_y' follows non-static declaration
screen.c:44: error: previous declaration of 'curs_dock_y' was here
*** Error code 1

Stop.
bmake: stopped in /Volumes/NetBSD/pkgsrc/net/trafshow/work/trafshow-5.2.1
*** Error code 1

Stop.


After applying the first patch, below, the build again fails on MacOS
X 10.4.6 as follows:

[...]
gcc -pipe -O2 -I/usr/include -Wall -I. -DHAVE_CONFIG_H  -D_REENTRANT -c domain_resolver.c
domain_resolver.c: In function 'nameserver_request':
domain_resolver.c:467: error: 'MAXDNAME' undeclared (first use in this function)
domain_resolver.c:467: error: (Each undeclared identifier is reported only once
domain_resolver.c:467: error: for each function it appears in.)
domain_resolver.c:490: warning: pointer targets in assignment differ in signedness
domain_resolver.c:499: warning: pointer targets in assignment differ in signedness
domain_resolver.c:467: warning: unused variable 'buf'
domain_resolver.c: In function 'nameserver_send':
domain_resolver.c:543: error: 'HEADER' undeclared (first use in this function)
domain_resolver.c:543: error: 'hp' undeclared (first use in this function)
domain_resolver.c:543: error: parse error before ')' token
domain_resolver.c:552: error: 'HFIXEDSZ' undeclared (first use in this function)
domain_resolver.c:558: error: 'QFIXEDSZ' undeclared (first use in this function)
domain_resolver.c:571: warning: implicit declaration of function 'PUTSHORT'
domain_resolver.c:571: error: 'T_A' undeclared (first use in this function)
domain_resolver.c:574: error: 'T_PTR' undeclared (first use in this function)
domain_resolver.c:577: error: 'T_MX' undeclared (first use in this function)
domain_resolver.c:580: error: 'C_IN' undeclared (first use in this function)
domain_resolver.c:585: warning: pointer targets in passing argument 2 of 'session_send' differ in signedness
domain_resolver.c: In function 'nameserver_reply':
domain_resolver.c:629: error: 'NOERROR' undeclared (first use in this function)
domain_resolver.c: In function 'parse_packet':
domain_resolver.c:662: error: 'HEADER' undeclared (first use in this function)
domain_resolver.c:662: error: 'hp' undeclared (first use in this function)
domain_resolver.c:662: error: parse error before ')' token
domain_resolver.c:663: error: 'HFIXEDSZ' undeclared (first use in this function)
domain_resolver.c:669: error: 'MAXDNAME' undeclared (first use in this function)
domain_resolver.c:686: error: 'NOERROR' undeclared (first use in this function)
domain_resolver.c:686: error: 'REFUSED' undeclared (first use in this function)
domain_resolver.c:719: error: 'INT16SZ' undeclared (first use in this function)
domain_resolver.c:724: warning: implicit declaration of function 'GETSHORT'
domain_resolver.c:726: error: 'C_IN' undeclared (first use in this function)
domain_resolver.c:731: error: 'T_A' undeclared (first use in this function)
domain_resolver.c:732: error: 'T_PTR' undeclared (first use in this function)
domain_resolver.c:733: error: 'T_MX' undeclared (first use in this function)
domain_resolver.c:752: error: 'INT32SZ' undeclared (first use in this function)
domain_resolver.c:759: warning: implicit declaration of function 'GETLONG'
domain_resolver.c:837: error: 'T_CNAME' undeclared (first use in this function)
domain_resolver.c:669: warning: unused variable 'name'
*** Error code 1

Stop.
bmake: stopped in /Volumes/NetBSD/pkgsrc/net/trafshow/work/trafshow-5.2.1
*** Error code 1

Stop.
bmake: stopped in /usr/pkgsrc/net/trafshow
[...]

>How-To-Repeat:
The first problem will appear if one attempts to build net/trafshow
on any system using GCC4.

The second problem may be specific to MacOS X 10.4.? and will appear
when one attempts to build net/trafshow on MacOS X 10.4.x.
>Fix:
The first problem is just bad or sloppy programming.  The following
patch fixes it:

--- work/trafshow-5.2.1/screen.c.orig   2006-06-02 12:48:14.000000000 -0500
+++ work/trafshow-5.2.1/screen.c        2006-06-02 12:48:37.000000000 -0500
@@ -41,8 +41,6 @@
 int prompt_mode = 0;
 double line_factor = 1;
 
-extern int curs_dock_x, curs_dock_y;
-
 /*
  * Initialize curses.
  */


The second problem appears to affect MacOS X 10.4.x systems only,
due to some variations in macro definitions.  This may be worked
around by the following patch:

--- work/trafshow-5.2.1/domain_resolver.c.orig  2006-06-02 12:56:12.000000000 -0500
+++ work/trafshow-5.2.1/domain_resolver.c       2006-06-02 12:56:36.000000000 -0500
@@ -16,7 +16,7 @@
 #include <sys/socket.h>
 #include <netinet/in.h>
 #include <arpa/inet.h>
-#include <arpa/nameser.h>
+#include <arpa/nameser_compat.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>


Following application of both these patches, net/trafshow builds,
installs and runs just fine on MacOS X 10.4.6