[omniORB] VC6 Compiler Warning?

Duncan Grisby dgrisby@uk.research.att.com
Wed, 25 Apr 2001 17:18:25 +0100


On Wednesday 25 April, "Simkin, Rick" wrote:

> Stroustrup says this about C++
> 
>     By default a floating-point literal is of type double.
>      . . .
>     If you want a floating-point literal of type float, you can define
>     one using the suffix f or F.

Yes, but the automatic conversion rules should take care of it. If I
did:

  double d = -1.00000001335e-010;
  float f = d;

I wouldn't expect any compiler warnings. Stroustrop also says

  "...a compiler ought to warn about floating-point literals that are
   too large to be represented."

It doesn't say anything about too precise to be represented.

Anyway, since appending F fixes it, I'll update omniidl to do that. I
just hope it doesn't upset any of the other C++ compilers we target...

Cheers,

Duncan.

-- 
 -- Duncan Grisby  \  Research Engineer  --
  -- AT&T Laboratories Cambridge          --
   -- http://www.uk.research.att.com/~dpg1 --