From owner-freebsd-ports-bugs@FreeBSD.ORG Mon Jul 12 16:50:03 2010 Return-Path: Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1DC9E106566B for ; Mon, 12 Jul 2010 16:50:03 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id D19B18FC13 for ; Mon, 12 Jul 2010 16:50:02 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id o6CGo2gB091251 for ; Mon, 12 Jul 2010 16:50:02 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id o6CGo22n091250; Mon, 12 Jul 2010 16:50:02 GMT (envelope-from gnats) Resent-Date: Mon, 12 Jul 2010 16:50:02 GMT Resent-Message-Id: <201007121650.o6CGo22n091250@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Jeremy Chadwick Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D6E451065672 for ; Mon, 12 Jul 2010 16:48:39 +0000 (UTC) (envelope-from jdc@koitsu.dyndns.org) Received: from QMTA11.westchester.pa.mail.comcast.net (qmta11.westchester.pa.mail.comcast.net [76.96.59.211]) by mx1.freebsd.org (Postfix) with ESMTP id 8677A8FC14 for ; Mon, 12 Jul 2010 16:48:39 +0000 (UTC) Received: from omta21.westchester.pa.mail.comcast.net ([76.96.62.72]) by QMTA11.westchester.pa.mail.comcast.net with comcast id h1Zd1e0031ZXKqc5B4ofyM; Mon, 12 Jul 2010 16:48:39 +0000 Received: from koitsu.dyndns.org ([98.248.41.155]) by omta21.westchester.pa.mail.comcast.net with comcast id h4oe1e0043LrwQ23h4oejp; Mon, 12 Jul 2010 16:48:39 +0000 Received: by icarus.home.lan (Postfix, from userid 1000) id 231759B425; Mon, 12 Jul 2010 09:48:37 -0700 (PDT) Message-Id: <20100712164837.231759B425@icarus.home.lan> Date: Mon, 12 Jul 2010 09:48:37 -0700 (PDT) From: Jeremy Chadwick To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: R.E.Wolff@BitWizard.nl Subject: ports/148524: net/mtr 0.79 -- RES_INIT macro conflict and unused variables on systems w/out IPv6 X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Jeremy Chadwick List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Jul 2010 16:50:03 -0000 >Number: 148524 >Category: ports >Synopsis: net/mtr 0.79 -- RES_INIT macro conflict and unused variables on systems w/out IPv6 >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Mon Jul 12 16:50:02 UTC 2010 >Closed-Date: >Last-Modified: >Originator: Jeremy Chadwick >Release: FreeBSD 8.1-PRERELEASE amd64 >Organization: >Environment: System: FreeBSD icarus.home.lan 8.1-PRERELEASE FreeBSD 8.1-PRERELEASE #0: Tue Jun 8 05:01:22 PDT 2010 root@icarus.home.lan:/usr/obj/usr/src/sys/X7SBA_RELENG_8_amd64 amd64 >Description: The author of mtr appears to have chosen a name for a macro which already exists on FreeBSD: if cc -DHAVE_CONFIG_H -I. -I. -I. -O2 -pipe -march=nocona -fno-strict-aliasing -Wall -Wno-pointer-sign -MT dns.o -MD -MP -MF ".deps/dns.Tpo" -c -o dns.o dns.c; \ then mv -f ".deps/dns.Tpo" ".deps/dns.Po"; else rm -f ".deps/dns.Tpo"; exit 1; fi dns.c:313:1: warning: "RES_INIT" redefined In file included from dns.c:38: /usr/include/resolv.h:230:1: warning: this is the location of the previous definition The difference is pretty severe however, meaning this could bite us later: # cd /usr/ports/net/mtr # grep -r RES_INIT . ./work/mtr-0.79/dns.c:#define RES_INIT() res_ninit(&myres); ./work/mtr-0.79/dns.c:#define RES_INIT() res_init(); ./work/mtr-0.79/dns.c: RES_INIT(); icarus# grep RES_INIT /usr/include/resolv.h #define RES_INIT 0x00000001 /*%< address initialized */ One's a macro to either res_init() or res_ninit(), while the other is a bitfield for resolver options. Ouch. Next we have an "unused variable" warning which only happens if the software is built without IPv6 support: if cc -DHAVE_CONFIG_H -I. -I. -I. -O2 -pipe -march=nocona -fno-strict-aliasing -Wall -Wno-pointer-sign -MT net.o -MD -MP -MF ".deps/net.Tpo" -c -o net.o net.c; \ then mv -f ".deps/net.Tpo" ".deps/net.Po"; else rm -f ".deps/net.Tpo"; exit 1; fi net.c: In function 'net_send_query': net.c:301: warning: unused variable 'offset' This one is easy to fix -- there's a missing #ifdef and #endif. >How-To-Repeat: Attempt to build net/mtr 0.79, particularly on a system with WITHOUT_IPV6 defined in make.conf (or maybe WITHOUT_INET6 in src.conf). >Fix: The easiest way to deal with this is to rename mtr's macro to something like MY_RES_INIT. As far as the unused variables goes, adding the necessary #ifdef/#endif should be sufficient. Below are two patch that should do both things. Drop 'em in files/. These issues should be reported upstream to the author to be fixed in the official source. I've CC'd him here. --- dns.c.orig 2010-06-06 23:58:23.000000000 -0700 +++ dns.c 2010-07-12 09:40:15.000000000 -0700 @@ -310,12 +310,12 @@ int use_dns = 1; #ifdef res_ninit -#define RES_INIT() res_ninit(&myres); +#define MY_RES_INIT() res_ninit(&myres); #define RES_MKQUERY(a, b, c, d, e, f, g, h, i) \ res_nmkquery(&myres, a, b, c, d, e, f, g, h, i) struct __res_state myres; #else -#define RES_INIT() res_init(); +#define MY_RES_INIT() res_init(); #define RES_MKQUERY(a, b, c, d, e, f, g, h, i) \ res_mkquery(a, b, c, d, e, f, g, h, i) #define myres _res @@ -495,7 +495,7 @@ int option,i; if (!dns) return; - RES_INIT(); + MY_RES_INIT(); if (!myres.nscount) { fprintf(stderr,"No nameservers defined.\n"); exit(-1); --- net.c.orig 2010-06-06 23:58:25.000000000 -0700 +++ net.c 2010-07-12 09:45:08.000000000 -0700 @@ -297,8 +297,10 @@ ttl = index + 1; +#ifdef ENABLE_IPV6 /* offset for ipv6 checksum calculation */ int offset = 6; +#endif if ( packetsize < MINPACKET ) packetsize = MINPACKET; if ( packetsize > MAXPACKET ) packetsize = MAXPACKET; >Release-Note: >Audit-Trail: >Unformatted: