[sword-devel] problems compiling sword

Daniel Glassey danglassey at ntlworld.com
Thu Oct 14 02:57:47 MST 2004


On Mon, 2004-10-11 at 21:08, Chris Umphress wrote:
> On Mon, 11 Oct 2004 11:57:28 -0300, lescribe at bonbon.net 
> > first off, it tells me that:
> > ../src/mgr/installmgr.cpp: In member function `char
> >    sword::InstallMgr::FTPURLGetFile(void*, const char*, const char*)':
> > ../src/mgr/installmgr.cpp:158: warning: converting of negative value `-1' to `
> >    char'
> 
> Warnings shouldn't stop the compile process. Are there any error
> messages as well?

afair a debug build is built with -Werror so all warnings are treated as
errors and stop the build.

Regards,
Daniel
 
> > so i go into the installmgr.cpp file and i realize that on line 132, it has
> > retVal declared as a char, but later on, it seems like it is used as a
> > if/then value, and should be an int. so i changed the line from:
> >         char retVal = 0;
> > to:
> >  int retVal = 0;
> 
> in C++, you can assign integer values to a char. For instance, if you
> wanted to make "char retVal" equal a space, you could set it with
> 
> retVal = 32; //or
> retVal = ' ';
> 
> I'm not sure why this would stop a compile, though.
> 
> > 
> > now it compiles. However, i run into another problem later on. it says:
> > 
> >  ../src/modules/common/rawstr.cpp -o rawstr.o
> > ../src/modules/common/rawstr.cpp: In member function `void
> >    sword::RawStr::doSetText(const char*, const char*, long int)':
> > ../src/modules/common/rawstr.cpp:419: warning: comparison is always true due
> > to
> >    limited range of data type
> > 
> > so i go to line 419, and this is what the comparison is:
> > else if (strcmp(key, dbKey) > 0) {
> >                 if (errorStatus != -2)  // not a new file
> >                         idxoff += 6;
> >                 else idxoff = 0;
> >         }
> > 
> 
> Interesting warning message. It looks good to me off the top of my
> head. strcmp() should be able to return possitive, 0, or negative. Are
> there any error messages around this, or is it only the warning?
> 
> > 
> > gavin
> > 
> > prov. 4.23
> 
> God bless,
> Chris
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://www.crosswire.org/pipermail/sword-devel/attachments/20041014/792c324f/attachment.bin


More information about the sword-devel mailing list