[omniORB] VC6 Compiler Warning?

Olaf Meding olaf@tomotherapy.com
Wed, 25 Apr 2001 10:45:52 -0500


Mike,

Did you make sure that VC6 did not re-compile the IDL file which in turn
will overwrite you change?

My VC6 project is a Win32 (non MFC) command line program with all the IDE
default project settings.


Olaf


-----Original Message-----
From: owner-omniorb-list@uk.research.att.com
[mailto:owner-omniorb-list@uk.research.att.com]On Behalf Of Quinlan,
Mike
Sent: Wednesday, April 25, 2001 10:37 AM
Cc: omniORB Mailing List
Subject: RE: [omniORB] VC6 Compiler Warning?


With my version of Visual C++ (6.0 with service pack 5), appending the F
does remove the warning.

-----Original Message-----
From: Duncan Grisby [mailto:dgrisby@uk.research.att.com]
Sent: Wednesday, April 25, 2001 8:42 AM
To: Olaf Meding
Cc: omniORB Mailing List
Subject: Re: [omniORB] VC6 Compiler Warning?


On Wednesday 25 April, "Olaf Meding" wrote:

> Here is the code produced by the IDL compiler that causes the warning:
>   extern const CORBA::Float invalidFloat=-1.00000001335e-010;
>
> AFAIK the constant should be appended with an F (for float)?

Does appending an F actually suppress the warning?  My guess is that
it's actually warning about the .00000001335 at the end, which exceeds
the precision of float, rather than the fact that the literal has type
double. The ending is just because 1e-10 can't be represented
precisely in binary floating point. The IDL compiler doesn't bother to
truncate away rubbish at the end of the value since it doesn't
matter. If appending F fixes it, then the fix to the IDL compiler is
simple; if not, it'll mean a bit of tricky string formatting.

This hasn't come up before since I guess people don't tend to use
floating point constants.

Cheers,

Duncan.

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