Bug 99697

Summary: Compile error on solaris 2.6 - codegenerator.cpp:685: error: `index' undeclared
Product: [Applications] umbrello Reporter: Steve Evans <stevee>
Component: generalAssignee: Oliver Kellogg <okellogg>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Solaris   
Latest Commit: Version Fixed In:

Description Steve Evans 2005-02-18 13:06:21 UTC
Version:            (using KDE KDE 3.3.92)
Installed from:    Compiled From Sources
Compiler:          gcc 3.4.3 
OS:                Solaris

I get this compile error:

if g++ -DHAVE_CONFIG_H -I. -I. -I../.. -Idialogs -Irefactoring -I/opt/kde/include -I/opt/qt/include   -I/gorbag/exta/cad/externals/SOLARIS/include  -DQT_THREAD_SUPPORT -I/opt/kde/include -I/gorbag/exta/cad/externals/SOLARIS/include -I/opt/qt/include  -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -DUSE_SOLARIS -DSVR4  -Wnon-virtual-dtor -Wno-long-long -Wundef -Wall -W -Wpointer-arith -Wwrite-strings -DNDEBUG -DNO_DEBUG -O2 -I/opt/kde/include -I/gorbag/exta/cad/externals/SOLARIS/include -I/opt/qt/include -O2 -fomit-frame-pointer -DNeedVarargsPrototypes=1 -DNeedFunctionPrototypes=1 -pipe -fno-exceptions -mcpu=ultrasparc -fno-exceptions -fno-check-new -fno-common -DQT_CLEAN_NAMESPACE -DQT_NO_ASCII_CAST -DQT_NO_STL -DQT_NO_COMPAT -DQT_NO_TRANSLATION  -MT codegenerator.o -MD -MP -MF ".deps/codegenerator.Tpo" -c -o codegenerator.o codegenerator.cpp; \
then mv -f ".deps/codegenerator.Tpo" ".deps/codegenerator.Po"; else rm -f ".deps/codegenerator.Tpo"; exit 1; fi
codegenerator.cpp: In member function `QString CodeGenerator::formatDoc(const QString&, const QString&, int)':
codegenerator.cpp:685: error: `index' undeclared (first use this function)
codegenerator.cpp:685: error: (Each undeclared identifier is reported only once for each functionit appears in.)
Comment 1 Steve Evans 2005-02-18 13:19:47 UTC
Adding

#include <strings.h>

fixes it
Comment 2 Oliver Kellogg 2005-02-18 15:29:19 UTC
Whoa! This one's on me. Thanks for noticing.
Comment 3 Oliver Kellogg 2005-02-18 18:08:47 UTC
CVS commit by okellogg: 

BUG:99697 - formatDoc(): Fix declaration of index.


  M +1 -1      ChangeLog   1.66
  M +2 -1      umbrello/codegenerator.cpp   1.65


--- kdesdk/umbrello/ChangeLog  #1.65:1.66
@@ -28,5 +28,5 @@
 92781 92995 93122 93219 93297 93298 93501 93535 93696 94173
 94728 94795 94883 95082 95247 95252 95722 95924 95951 95954
-96216 96221 96964 97155 97182 97697 97887 97984
+96216 96221 96964 97155 97182 97697 97887 97984 98899 99697
 
 Version 1.3

--- kdesdk/umbrello/umbrello/codegenerator.cpp  #1.64:1.65
@@ -678,6 +678,7 @@ QString CodeGenerator::formatDoc(const Q
                         continue;
                 }
+                int index;
                 do {
-                        const int index = comment.findRev(" ", lineWidth + 1);
+                        index = comment.findRev(" ", lineWidth + 1);
                         output += linePrefix + input.left(index) + endLine; // add line
                         input.remove(0, index + 1);     //and remove processed string, including