New warning with MSVC6

View: New views
5 Messages — Rating Filter:   Alert me  

New warning with MSVC6

by cppunit-devel mailing list :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello.

There is a new compilation warning with MSVC6 :

TestAssert.cpp
f:\sourceforge\cppunit\cppunit\include\cppunit\portability\floatingpoint.h(42)
: warning C4800: 'int' : forcing value to bool 'true' or 'false'
(performance warning)

The cause is in cppunit/include/cppunit/portability/FloatingPoint.h
function floatingPointIsFinite()

#elif defined(CPPUNIT_HAVE__FINITE)
    return _finite(x);
#else

The _finite() return value is an int.
Furthermore, casting to bool is not enough to remove the warning.

The above line could be fixed with :
    return _finite(x) ? true : false;

Could someone check this in please ?

Vincent Rivière
vriviere@...

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Cppunit-devel mailing list
Cppunit-devel@...
https://lists.sourceforge.net/lists/listinfo/cppunit-devel

Parent Message unknown Re: New warning with MSVC6

by cppunit-devel mailing list :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Vincent,

An easier fix is to have floatingPointIsFinite() return an int, since
that is what isfinite(), finite() and _finite() all do.

-Steve


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Cppunit-devel mailing list
Cppunit-devel@...
https://lists.sourceforge.net/lists/listinfo/cppunit-devel

Parent Message unknown Re: New warning with MSVC6

by cppunit-devel mailing list :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Vincent,

An easier fix is to have floatingPointIsFinite() return an int, since
that is what isfinite(), finite() and _finite() all do.

-Steve


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Cppunit-devel mailing list
Cppunit-devel@...
https://lists.sourceforge.net/lists/listinfo/cppunit-devel

Re: New warning with MSVC6

by cppunit-devel mailing list :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

> An easier fix is to have floatingPointIsFinite() return an int, since
> that is what isfinite(), finite() and _finite() all do.

You're right !

Could someone commit that, please ?

Vincent Rivière
vriviere@...

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Cppunit-devel mailing list
Cppunit-devel@...
https://lists.sourceforge.net/lists/listinfo/cppunit-devel

Re: New warning with MSVC6

by cppunit-devel mailing list :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Sat, Mar 03, 2007 at 04:12:51PM +0100, CppUnit development mailing list wrote:
> > An easier fix is to have floatingPointIsFinite() return an int, since
> > that is what isfinite(), finite() and _finite() all do.
>
> You're right !
>
> Could someone commit that, please ?

Done.

-Steve


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Cppunit-devel mailing list
Cppunit-devel@...
https://lists.sourceforge.net/lists/listinfo/cppunit-devel