Bug 101556 - kdesdk compile errors on amd64/gcc4
Summary: kdesdk compile errors on amd64/gcc4
Status: RESOLVED FIXED
Alias: None
Product: kcachegrind
Classification: Developer tools
Component: general (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Josef Weidendorfer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-03-15 16:20 UTC by Ana Guerrero (Debian KDE maintainers)
Modified: 2005-03-21 22:49 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments
kdesdk patch for amd64 w/ gcc4 (2.14 KB, patch)
2005-03-15 16:21 UTC, Ana Guerrero (Debian KDE maintainers)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ana Guerrero (Debian KDE maintainers) 2005-03-15 16:20:39 UTC
Version:            (using KDE Devel)
Installed from:    Compiled sources
Compiler:          gcc 4.0 prerelease 
OS:                Linux

http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=287032 informs us that kdesdk doesn't build on amd64 using the upcoming gcc4:

../../../kcachegrind/kcachegrind/callgraphview.cpp: In member function 'void GraphExporter::writeDot()':
../../../kcachegrind/kcachegrind/callgraphview.cpp:579: error: cast from 'TraceFunction*' to 'int' loses precision
../../../kcachegrind/kcachegrind/callgraphview.cpp:594: error: cast from 'TraceFunction*' to 'int' loses precision
../../../kcachegrind/kcachegrind/callgraphview.cpp:633: error: cast from 'TraceFunction*' to 'int' loses precision
../../../kcachegrind/kcachegrind/callgraphview.cpp:634: error: cast from 'TraceFunction*' to 'int' loses precision
../../../kcachegrind/kcachegrind/callgraphview.cpp:672: error: cast from 'TraceFunction*' to 'int' loses precision
../../../kcachegrind/kcachegrind/callgraphview.cpp:674: error: cast from 'TraceFunction*' to 'int' loses precision
../../../kcachegrind/kcachegrind/callgraphview.cpp:675: error: cast from 'TraceFunction*' to 'int' loses precision
../../../kcachegrind/kcachegrind/callgraphview.cpp:695: error: cast from 'TraceFunction*' to 'int' loses precision
../../../kcachegrind/kcachegrind/callgraphview.cpp:697: error: cast from 'TraceFunction*' to 'int' loses precision
../../../kcachegrind/kcachegrind/callgraphview.cpp:698: error: cast from 'TraceFunction*' to 'int' loses precision
make[4]: *** [callgraphview.o] Error 1

I've attached the patch that was provided to us, adapted to apply to the latest code. If you do apply it, please backport to 3_4_BRANCH as well.

Thanks!
Comment 1 Ana Guerrero (Debian KDE maintainers) 2005-03-15 16:21:16 UTC
Created attachment 10128 [details]
kdesdk patch for amd64 w/ gcc4
Comment 2 Josef Weidendorfer 2005-03-21 22:49:11 UTC
CVS commit by weidendo: 

We use hexadecimal hash values as identifiers for
nodes in a graph to be layouted by GraphViz. These IDs
are simply the address of the function object.
Fix: Use "long" as ID type for pointers both on 32/64bit platforms. 
Thanks to Debian for the patch.
BUGS:101556


  M +11 -11    callgraphview.cpp   1.21


--- kdesdk/kcachegrind/kcachegrind/callgraphview.cpp  #1.20:1.21
@@ -580,5 +580,5 @@ void GraphExporter::writeDot()
     }
     if (f)
-      *stream << QString("  center=F%1;\n").arg((int)f, 0, 16);
+      *stream << QString("  center=F%1;\n").arg((long)f, 0, 16);
     *stream << QString("  overlap=false;\n  splines=true;\n");
   }
@@ -631,5 +631,5 @@ void GraphExporter::writeDot()
         abr = abr.left(Configuration::maxSymbolLength()) + "...";
       
-      *stream << QString("  F%1 [").arg((int)f, 0, 16);
+      *stream << QString("  F%1 [").arg((long)f, 0, 16);
       if (_useBox) {
         // make label 3 lines for CallGraphView
@@ -674,7 +674,7 @@ void GraphExporter::writeDot()
 
     *stream << QString("  F%1 -> F%2 [weight=%3")
-      .arg((int)e.from(), 0, 16)
-      .arg((int)e.to(), 0, 16)
-      .arg((int)log(log(e.cost)));
+      .arg((long)e.from(), 0, 16)
+      .arg((long)e.to(), 0, 16)
+      .arg((long)log(log(e.cost)));
 
     if (_go->detailLevel() ==1)
@@ -713,8 +713,8 @@ void GraphExporter::writeDot()
 
               *stream << QString("  R%1 [shape=point,label=\"\"];\n")
-                  .arg((int)n.function(), 0, 16);
+                  .arg((long)n.function(), 0, 16);
               *stream << QString("  R%1 -> F%2 [label=\"%3\\n%4 x\",weight=%5];\n")
-                  .arg((int)n.function(), 0, 16)
-                  .arg((int)n.function(), 0, 16)
+                  .arg((long)n.function(), 0, 16)
+                  .arg((long)n.function(), 0, 16)
                   .arg(SubCost(costSum).pretty())
                   .arg(SubCost(countSum).pretty())
@@ -736,8 +736,8 @@ void GraphExporter::writeDot()
 
               *stream << QString("  S%1 [shape=point,label=\"\"];\n")
-                  .arg((int)n.function(), 0, 16);
+                  .arg((long)n.function(), 0, 16);
               *stream << QString("  F%1 -> S%2 [label=\"%3\\n%4 x\",weight=%5];\n")
-                  .arg((int)n.function(), 0, 16)
-                  .arg((int)n.function(), 0, 16)
+                  .arg((long)n.function(), 0, 16)
+                  .arg((long)n.function(), 0, 16)
                   .arg(SubCost(costSum).pretty())
                   .arg(SubCost(countSum).pretty())