From owner-freebsd-ports-bugs@FreeBSD.ORG Mon Oct 29 22:40:02 2007 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 F398016A468 for ; Mon, 29 Oct 2007 22:40:01 +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 D5DD113C4C6 for ; Mon, 29 Oct 2007 22:40:01 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.1/8.14.1) with ESMTP id l9TMe1sk028796 for ; Mon, 29 Oct 2007 22:40:01 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.1/8.14.1/Submit) id l9TMe1Eu028795; Mon, 29 Oct 2007 22:40:01 GMT (envelope-from gnats) Resent-Date: Mon, 29 Oct 2007 22:40:01 GMT Resent-Message-Id: <200710292240.l9TMe1Eu028795@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, Pietro Cerutti Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DCC9C16A469 for ; Mon, 29 Oct 2007 22:37:05 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21]) by mx1.freebsd.org (Postfix) with ESMTP id D03E513C481 for ; Mon, 29 Oct 2007 22:37:05 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.14.1/8.14.1) with ESMTP id l9TMb3Im087568 for ; Mon, 29 Oct 2007 22:37:03 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.14.1/8.14.1/Submit) id l9TMb3lj087567; Mon, 29 Oct 2007 22:37:03 GMT (envelope-from nobody) Message-Id: <200710292237.l9TMb3lj087567@www.freebsd.org> Date: Mon, 29 Oct 2007 22:37:03 GMT From: Pietro Cerutti To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: ports/117648: [patch] devel/a2dev fix building with GCC 4.2 + get rid of a few warnings X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Oct 2007 22:40:02 -0000 >Number: 117648 >Category: ports >Synopsis: [patch] devel/a2dev fix building with GCC 4.2 + get rid of a few warnings >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Mon Oct 29 22:40:01 UTC 2007 >Closed-Date: >Last-Modified: >Originator: Pietro Cerutti >Release: 6.2-STABLE >Organization: Bern University of Applied Sciences >Environment: FreeBSD gahrtop.localhost 6.2-STABLE FreeBSD 6.2-STABLE #3: Wed Oct 24 08:30:39 CEST 2007 root@gahrtop.localhost:/usr/obj/usr/src/sys/MSI1034 i386 >Description: devel/a2dev doesn't build with GCC 4.2 because of a cast expression used as an lvalue. Moreover, there a are a few warnings which are easily fixed (missing includes, ..) >How-To-Repeat: cd /usr/ports/devel/a2dev && make >Fix: add the following patch as files/path-ai --- util/error.c.orig 2007-10-29 23:28:26.000000000 +0100 +++ util/error.c 2007-10-29 23:29:40.000000000 +0100 @@ -7,6 +7,7 @@ */ #include +#include #include #include "util.h" #include "error.h" --- util/hash.c.orig 2007-10-29 23:27:57.000000000 +0100 +++ util/hash.c 2007-10-29 23:29:40.000000000 +0100 @@ -28,9 +28,13 @@ Hash(void *bytes, unsigned length) { unsigned crc = CRC_INIT; + unsigned char byte; + unsigned len = 0; - while (length--) - crc = table[(crc ^ *((unsigned char *) bytes)++) & 0xFF] ^ (crc >> 8); + for(len=0; len> 8); + } return(crc ^ CRC_FINAL); } --- util/names.c.orig 2007-10-29 23:28:43.000000000 +0100 +++ util/names.c 2007-10-29 23:29:40.000000000 +0100 @@ -6,6 +6,7 @@ */ #include +#include #include "util.h" #include "error.h" #include "hash.h" --- asm/emit.c.orig 2007-10-29 23:28:20.000000000 +0100 +++ asm/emit.c 2007-10-29 23:29:44.000000000 +0100 @@ -191,7 +191,7 @@ /* Try to do zero page */ - if (zmode >= 0 && CheckOp(ins, zmode) >= 0) + if (zmode >= 0 && CheckOp(ins, zmode) >= 0) { if (ivalue->type == iSegRel && ivalue->u.segrel.segment == AbsSegment && (ivalue->u.segrel.offset & ~0xFF) == 0) @@ -207,6 +207,7 @@ EmitIvalue(ivalue, FALSE, 0x01); return; } + } /* Can we ONLY do zero page (but didn't)? */ @@ -239,7 +240,7 @@ /* Compute displacement to target address */ - if (gPass == 2) + if (gPass == 2) { if (ivalue->type != iSegRel || ivalue->u.segrel.segment != gSegment) uerror("illegal branch address"); else @@ -248,6 +249,7 @@ if (disp < -128 || disp > 127) uerror("branch of %d bytes is out of range", disp); } + } /* Done */ >Release-Note: >Audit-Trail: >Unformatted: