Date: Mon, 12 Feb 2007 04:18:53 GMT From: Coleman Kane <cokane@FreeBSD.org> To: FreeBSD-gnats-submit@FreeBSD.org Subject: ports/109073: net-mgmt/kismet GPSMAP option broken on !32-bit platforms Message-ID: <200702120418.l1C4Ir5I067407@freefall.freebsd.org> Resent-Message-ID: <200702120420.l1C4K6hi067454@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>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<int>(tmp); + thread_status = reinterpret_cast<intptr_t>(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:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200702120418.l1C4Ir5I067407>