From owner-freebsd-ports-bugs@FreeBSD.ORG Mon Feb 12 04:20:06 2007 Return-Path: X-Original-To: freebsd-ports-bugs@hub.freebsd.org Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D375516A408 for ; Mon, 12 Feb 2007 04:20:06 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [69.147.83.40]) by mx1.freebsd.org (Postfix) with ESMTP id B412C13C48E for ; Mon, 12 Feb 2007 04:20:06 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id l1C4K6b3067455 for ; Mon, 12 Feb 2007 04:20:06 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id l1C4K6hi067454; Mon, 12 Feb 2007 04:20:06 GMT (envelope-from gnats) Resent-Date: Mon, 12 Feb 2007 04:20:06 GMT Resent-Message-Id: <200702120420.l1C4K6hi067454@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, Coleman Kane Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id DF74816A408 for ; Mon, 12 Feb 2007 04:18:53 +0000 (UTC) (envelope-from cokane@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [69.147.83.40]) by mx1.freebsd.org (Postfix) with ESMTP id CFED213C428 for ; Mon, 12 Feb 2007 04:18:53 +0000 (UTC) (envelope-from cokane@FreeBSD.org) Received: from freefall.freebsd.org (cokane@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id l1C4IrPf067408 for ; Mon, 12 Feb 2007 04:18:53 GMT (envelope-from cokane@freefall.freebsd.org) Received: (from cokane@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id l1C4Ir5I067407; Mon, 12 Feb 2007 04:18:53 GMT (envelope-from cokane) Message-Id: <200702120418.l1C4Ir5I067407@freefall.freebsd.org> Date: Mon, 12 Feb 2007 04:18:53 GMT From: Coleman Kane To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: Subject: ports/109073: net-mgmt/kismet GPSMAP option broken on !32-bit platforms X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Coleman Kane List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Feb 2007 04:20:06 -0000 >Number: 109073 >Category: ports >Synopsis: net-mgmt/kismet GPSMAP option broken on !32-bit platforms >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Mon Feb 12 04:20:05 GMT 2007 >Closed-Date: >Last-Modified: >Originator: Coleman Kane >Release: FreeBSD 7.0-CURRENT amd64 >Organization: FreeBSD Committers >Environment: FreeBSD erwin 7.0-CURRENT FreeBSD 7.0-CURRENT #2: Mon Feb 5 12:38:42 MST 2007 root@erwin:/usr/obj/usr/src/sys/ERWIN amd64 >Description: When building net-mgmt/kismet with the GPSMAP option turned on, the build will fail on a non 32-bit architecture (actually any architecture where sizeof(int) != sizeof(void*)) due to the assumption that the "int" type and "void*" type can be safely "reinterpret_cast"ed. The following error will be reported trying to build gpsmap.cc: gpsmap.cc:2456: error: reinterpret_cast from `void*' to `int' loses precision In addition, a number of other type-size and signed-ness warnings will be spit out by the compiler, and should be looked into. >How-To-Repeat: Do the following (as root): cd /usr/ports/net-mgmt/kismet make config select "GPSMAP" option make (make will fail with the above error if you are on amd64, for instance) >Fix: The following patch uses intptr_t, rather than, int as the type definition so as to allow safe reinterpret_cast to convert the data type from pointer to integer. --- patch-kismet-gpsmap.cc begins here --- --- gpsmap.cc.orig Sun Feb 11 23:06:50 2007 +++ gpsmap.cc Sun Feb 11 23:04:48 2007 @@ -2449,11 +2449,11 @@ pthread_attr_destroy(&attr); // Now wait for the threads to complete and come back - int thread_status; + intptr_t thread_status; for (int t = 0; t < numthreads; t++) { void *tmp; pthread_join(mapthread[t], &tmp); - thread_status = reinterpret_cast(tmp); + thread_status = reinterpret_cast(tmp); } #else // Run one instance of our "thread". thread number 0, it should just crunch it all --- patch-kismet-gpsmap.cc ends here --- >Release-Note: >Audit-Trail: >Unformatted: