Date: Mon, 29 Oct 2007 22:37:03 GMT From: Pietro Cerutti <gahr@gahr.ch> To: freebsd-gnats-submit@FreeBSD.org Subject: ports/117648: [patch] devel/a2dev fix building with GCC 4.2 + get rid of a few warnings Message-ID: <200710292237.l9TMb3lj087567@www.freebsd.org> Resent-Message-ID: <200710292240.l9TMe1Eu028795@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>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 <stdio.h> +#include <stdlib.h> #include <stdarg.h> #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<length; len++){ + byte = ((unsigned char *)bytes)[len]; + crc = table[(crc ^ byte) & 0xFF] ^ (crc >> 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 <stdio.h> +#include <string.h> #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:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200710292237.l9TMb3lj087567>