From owner-freebsd-bugs@FreeBSD.ORG Mon Nov 26 08:40:02 2012 Return-Path: Delivered-To: freebsd-bugs@smarthost.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0ACA8595 for ; Mon, 26 Nov 2012 08:40:02 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id D39378FC17 for ; Mon, 26 Nov 2012 08:40:01 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id qAQ8e1oP012887 for ; Mon, 26 Nov 2012 08:40:01 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id qAQ8e1KB012886; Mon, 26 Nov 2012 08:40:01 GMT (envelope-from gnats) Resent-Date: Mon, 26 Nov 2012 08:40:01 GMT Resent-Message-Id: <201211260840.qAQ8e1KB012886@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Garrett Cooper Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4240055E for ; Mon, 26 Nov 2012 08:35:26 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22]) by mx1.freebsd.org (Postfix) with ESMTP id 28C348FC08 for ; Mon, 26 Nov 2012 08:35:26 +0000 (UTC) Received: from red.freebsd.org (localhost [127.0.0.1]) by red.freebsd.org (8.14.5/8.14.5) with ESMTP id qAQ8ZQpi093383 for ; Mon, 26 Nov 2012 08:35:26 GMT (envelope-from nobody@red.freebsd.org) Received: (from nobody@localhost) by red.freebsd.org (8.14.5/8.14.5/Submit) id qAQ8ZQxr093382; Mon, 26 Nov 2012 08:35:26 GMT (envelope-from nobody) Message-Id: <201211260835.qAQ8ZQxr093382@red.freebsd.org> Date: Mon, 26 Nov 2012 08:35:26 GMT From: Garrett Cooper To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Subject: kern/173932: [patch] Fix compilation errors when -Werror specified in sys/boot/Makefile.inc X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Nov 2012 08:40:02 -0000 >Number: 173932 >Category: kern >Synopsis: [patch] Fix compilation errors when -Werror specified in sys/boot/Makefile.inc >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Mon Nov 26 08:40:01 UTC 2012 >Closed-Date: >Last-Modified: >Originator: Garrett Cooper >Release: 9-STABLE >Organization: EMC Isilon >Environment: FreeBSD bayonetta.local 9.1-PRERELEASE FreeBSD 9.1-PRERELEASE #0 r240836M: Sat Sep 22 12:30:11 PDT 2012 gcooper@bayonetta.local:/usr/obj/store/freebsd/stable/9/sys/BAYONETTA amd64 >Description: In order to catch errors for warnings I added -Werror to sys/boot/Makefile.inc, and I found a few issues. The attached patch resolves the warnings on amd64; I'm running a make tinderbox -DMAKE_JUST_WORLDS to validate that the changes are ok on other architectures as well. >How-To-Repeat: >Fix: Patch attached with submission follows: Index: sys/boot/Makefile.inc =================================================================== --- sys/boot/Makefile.inc (revision 243557) +++ sys/boot/Makefile.inc (working copy) @@ -1,3 +1,5 @@ # $FreeBSD$ SSP_CFLAGS= + +CFLAGS+= -Werror Index: sys/boot/common/dev_net.c =================================================================== --- sys/boot/common/dev_net.c (revision 243557) +++ sys/boot/common/dev_net.c (working copy) @@ -325,11 +325,10 @@ #endif d = socktodesc(sock); - sprintf(temp, "%6D", d->myea, ":"); setenv("boot.netif.ip", inet_ntoa(myip), 1); setenv("boot.netif.netmask", intoa(netmask), 1); setenv("boot.netif.gateway", inet_ntoa(gateip), 1); - setenv("boot.netif.hwaddr", temp, 1); + setenv("boot.netif.hwaddr", ether_sprintf(d->myea), 1); setenv("boot.nfsroot.server", inet_ntoa(rootip), 1); setenv("boot.nfsroot.path", rootpath, 1); Index: sys/boot/common/module.c =================================================================== --- sys/boot/common/module.c (revision 243557) +++ sys/boot/common/module.c (working copy) @@ -729,7 +729,7 @@ intp = (int*)recptr; reclen = *intp++; ival = *intp++; - cp = (char*)intp; + cp = (u_char*)intp; switch (ival) { case MDT_VERSION: clen = *cp++; @@ -761,9 +761,9 @@ * Finally check if KLD is in the place */ if (found) - result = file_lookup(mdp->d_path, cp, clen, NULL); + result = file_lookup(mdp->d_path, (char*)cp, clen, NULL); else if (best) - result = file_lookup(mdp->d_path, best, blen, NULL); + result = file_lookup(mdp->d_path, (char*)best, blen, NULL); bad: /* * If nothing found or hints is absent - fallback to the old way Index: sys/boot/efi/libefi/efipart.c =================================================================== --- sys/boot/efi/libefi/efipart.c (revision 243557) +++ sys/boot/efi/libefi/efipart.c (working copy) @@ -87,7 +87,8 @@ nout = 0; for (n = 0; n < nin; n++) { - status = BS->HandleProtocol(hin[n], &blkio_guid, &blkio); + status = BS->HandleProtocol(hin[n], &blkio_guid, + (VOID**)&blkio); if (EFI_ERROR(status)) continue; if (!blkio->Media->LogicalPartition) @@ -115,7 +116,7 @@ sprintf(line, " %s%d:", efipart_dev.dv_name, unit); pager_output(line); - status = BS->HandleProtocol(h, &blkio_guid, &blkio); + status = BS->HandleProtocol(h, &blkio_guid, (VOID**)&blkio); if (!EFI_ERROR(status)) { sprintf(line, " %llu blocks", (unsigned long long)(blkio->Media->LastBlock + 1)); @@ -144,7 +145,7 @@ if (h == NULL) return (EINVAL); - status = BS->HandleProtocol(h, &blkio_guid, &blkio); + status = BS->HandleProtocol(h, &blkio_guid, (VOID**)&blkio); if (EFI_ERROR(status)) return (efi_status_to_errno(status)); Index: sys/boot/i386/libi386/devicename.c =================================================================== --- sys/boot/i386/libi386/devicename.c (revision 243557) +++ sys/boot/i386/libi386/devicename.c (working copy) @@ -127,9 +127,8 @@ err = EUNIT; goto fail; } - } else { - cp = np; - } + } else + cp = __DECONST(np); if (*cp && (*cp != ':')) { err = EINVAL; goto fail; >Release-Note: >Audit-Trail: >Unformatted: