From owner-freebsd-ports@FreeBSD.ORG Fri Dec 23 20:13:06 2005 Return-Path: X-Original-To: freebsd-ports@freebsd.org Delivered-To: freebsd-ports@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 935C016A41F for ; Fri, 23 Dec 2005 20:13:06 +0000 (GMT) (envelope-from freebsd@sopwith.solgatos.com) Received: from schitzo.solgatos.com (c-67-168-241-176.hsd1.or.comcast.net [67.168.241.176]) by mx1.FreeBSD.org (Postfix) with ESMTP id E6C6043D64 for ; Fri, 23 Dec 2005 20:13:04 +0000 (GMT) (envelope-from freebsd@sopwith.solgatos.com) Received: from sopwith.solgatos.com (uucp@localhost) by schitzo.solgatos.com (8.11.6/8.11.6) with UUCP id jBNKDG916430; Fri, 23 Dec 2005 12:13:16 -0800 Received: from localhost by sopwith.solgatos.com (8.8.8/6.24) id UAA15211; Fri, 23 Dec 2005 20:12:59 GMT Message-Id: <200512232012.UAA15211@sopwith.solgatos.com> To: scott@mail.dsab.rresearch.com In-reply-to: Your message of "Thu, 22 Dec 2005 23:07:10 PST." <20051223070710.51F6561EF@sabami.seaslug.org> Date: Fri, 23 Dec 2005 12:12:59 +0000 From: Dieter Cc: freebsd-ports@freebsd.org Subject: nmh-1.2 bugs (was: Re: compiler can't tell int from function? nmh-1.0.4) X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Dec 2005 20:13:06 -0000 > Yes, it should...but I imagine that source is pretty old. I'm in the > process of trying to update the port to use the recently released > nmh-1.2 version (but there's a bug in that release that currently > prevents it from building). I'm doing my builds on FreeBSD 5.x, so I'm > not sure if I'll see the same error...but I'll try to patch it up when I > get that far. > > Scott (nmh port maintainer) Given the number of compiler warnings in nmh-1.0.4, I downloaded 1.2 and gave it a shot. Found 2 problems that prevent it from building. Here are quick & dirty, not production quality, kludges to get it to build (and also fix a couple warnings). Still has lots of warnings to be fixed (prototype, cast from pointer to integer of different size, etc.) Kind of sad to get "isn't a prototype" warnings from a file named prototypes.h rcsdiff -u -r1.1 uip/slocal.c =================================================================== RCS file: uip/RCS/slocal.c,v retrieving revision 1.1 diff -u -r1.1 uip/slocal.c --- uip/slocal.c 2005/12/23 18:55:11 1.1 +++ uip/slocal.c 2005/12/23 19:15:42 @@ -64,6 +64,9 @@ #endif #endif +/* Kludge, needed for FreeBSD 6.0 (perhaps others?) */ +#include + #include #ifndef HAVE_GETUTENT @@ -1371,12 +1374,17 @@ if (hp) { /* return path for UUCP style addressing */ ep = strchr(++hp, '\n'); + /* The pointer differences ought to be cast to long rather + * than int, but gcc complains. If the difference doesn't + * fit in an int (32 bits on both ILP32 and LP64) we have + * an absurdly large Return-Path. + */ snprintf (buffer, sizeof(buffer), "Return-Path: %.*s!%.*s\n", - ep - hp, hp, cp - fp, fp); + (int)(ep - hp), hp, (int)(cp - fp), fp); } else { /* return path for standard domain addressing */ snprintf (buffer, sizeof(buffer), "Return-Path: %.*s\n", - cp - fp, fp); + (int)(cp - fp), fp); } /* Add Return-Path header to message */ rcsdiff -u -r1.1 sbr/Makefile =================================================================== RCS file: sbr/RCS/Makefile,v retrieving revision 1.1 diff -u -r1.1 sbr/Makefile --- sbr/Makefile 2005/12/23 19:42:14 1.1 +++ sbr/Makefile 2005/12/23 19:54:04 @@ -102,7 +102,10 @@ # Note that some lexes (for example flex 2.5.4) require that there # be no space between -o and the output filename. dtimep.c: dtimep.lex - $(LEX) -o$@ $< + # The $< does not work (at least on FreeBSD 6.0) + # It expands to nothing, so flex just hangs. + # Quick & dirty kludge fix: just put in dtimep.lex + $(LEX) -o$@ dtimep.lex client.o: client.c $(COMPILE2) $<