casseopea2 / gperftools

Automatically exported from code.google.com/p/gperftools
BSD 3-Clause "New" or "Revised" License
1 stars 0 forks source link

Build problem for 1.0rc1 #87

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. ./configure; make    (with libunwind)

What is the expected output? What do you see instead?

src/heap-checker.cc: In function 'int get_thread_disable_counter()':
src/heap-checker.cc:453: error: cast from 'void*' to 'int' loses precision
make: *** [libtcmalloc_la-heap-checker.lo] Error 1

What version of the product are you using? On what operating system?

$ uname -a
Linux localhost 2.6.20-21 #1 SMP Wed Sep 17 17:52:22 PDT 2008 x86_64 x86_64
x86_64 GNU/Linux
$ g++ -v
Using built-in specs.
Target: x86_64-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man
--infodir=/usr/share/info --enable-shared --enable-threads=posix
--enable-checking=release --with-system-zlib --enable-__cxa_atexit
--disable-libunwind-exceptions --enable-libgcj-multifile
--enable-languages=c,c++,objc,java,f95,ada --enable-java-awt=gtk
--with-java-home=/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre
--host=x86_64-redhat-linux
Thread model: posix
gcc version 4.0.1 20050727 (Red Hat 4.0.1-5)

Please provide any additional information below.

Original issue reported on code.google.com by mrab...@gmail.com on 14 Dec 2008 at 11:03

GoogleCodeExporter commented 9 years ago
the offender is:

   void* p = ....;
   return (int) p;

reinterpret_cast<> also fails, so I suggest this fix:
   return (int) (long) p;

Original comment by mrab...@gmail.com on 14 Dec 2008 at 11:07

GoogleCodeExporter commented 9 years ago
To be a bit more standards compliant, it might be better to change the 
signature from int to intptr_t. See the 
attached patch. This now compiles on my x86-64 system.

Original comment by ev...@csail.mit.edu on 15 Dec 2008 at 12:09

Attachments:

GoogleCodeExporter commented 9 years ago
that's certainly better ;)

Original comment by mrab...@gmail.com on 15 Dec 2008 at 12:16

GoogleCodeExporter commented 9 years ago
Crikey!  Sorry for the problem.  If I finally got my act in gear to build 
64-bit .deb
files, I would catch things like this... :-/

I've fixed the bug and released perftools 1.0rc2.  Sorry for the trouble.

Original comment by csilv...@gmail.com on 15 Dec 2008 at 1:21