Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 23 Dec 2005 12:12:59 +0000
From:      Dieter <freebsd@sopwith.solgatos.com>
To:        scott@mail.dsab.rresearch.com
Cc:        freebsd-ports@freebsd.org
Subject:   nmh-1.2 bugs (was: Re: compiler can't tell int from function? nmh-1.0.4)
Message-ID:  <200512232012.UAA15211@sopwith.solgatos.com>
In-Reply-To: Your message of "Thu, 22 Dec 2005 23:07:10 PST." <20051223070710.51F6561EF@sabami.seaslug.org> 

next in thread | previous in thread | raw e-mail | index | archive | help
> 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 <ndbm.h>
+
 #include <utmp.h>
 
 #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) $<



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200512232012.UAA15211>