help-cgicc
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Warnings From BCB5


From: Edward Diener
Subject: Re: Warnings From BCB5
Date: Thu, 14 Feb 2002 17:28:51 -0500
User-agent: Mozilla/5.0 (Windows; U; WinNT4.0; en-US; rv:0.9.4) Gecko/20011019 Netscape6/6.2

Alexander J. Oss wrote:

I'm trying to compile cgicc with Borland C++Builder 5, and I thought I
should mention a warning I'm getting on two lines in Cgicc.cpp:

'pos' is assigned a value that is never used

is generated for lines 378 and 403.  In both cases, I think, it is the
unused initialization to zero that the compiler is warning us about.  For
line 403, the declaration of the variable can be moved inside the
while(true) loop.

(It also looks like there's a compiler bug; the use of DBL_MAX in BCB 5
looks like it's broken, as it requires std::DBL_MAX, which shouldn't be the
case.  But hopefully they've fixed that in the new BCB 6.)

Yes, this is a bug in BCB5 and has been discussed on the BCB language NG.
The fix for it in FormEntry.h is to add these lines after line 42, which is "#include <cfloat>,

#ifdef WIN32
#ifdef __BORLANDC__
#include <float.h>
#endif
#endif

I also had to change line 36 in FormFile.cpp from:

fDataType = dataType.empty() ? "text/plain" : dataType;

to:

fDataType = dataType.empty() ? STDNS string("text/plain") : dataType;

because of another bug in BCB5 which tries to tell me that the types in the ternary need to be the same. After querying this on the BCB language NG, others agreed with me that as long as the types are convertible to each other it should compile. By using the cast, thus forcing the types to be the same, it fixes the bug.

Edward Diener





reply via email to

[Prev in Thread] Current Thread [Next in Thread]