Hi Guys,
Testing my code with Ice 3.4.2 and noticed a change in generated code with regards to initializer lists in C++.
It's to do with float default values.
Example SLICE
class aClass
{
float a = 0.0;
float b = 1.1;
double c = 0.0;
double d = 1.1;
};
This used to generate
::aClass::aClass() :
a(0),
b(1.1),
c(0),
d(1.1)
Now it generates
::aClass::aClass() :
a(0F),
b(1.1F),
c(0),
d(1.1)
GCC and Visual Studio is now complaining about variable 'a' with an invalid suffix 'F'.
Having 'F' is more correct, however the parser should not be truncating default values for floats and doubles.
(float a = 0F) != (float a = 0.0F)
My only work around is not to set a default value of 0.0 anymore. Or hack the cpp/src/slice2cpp/Gen.cpp line 107 and remove the 'F' suffix.
VERY annoying..!
cheers
Denn

Reply With Quote