2 warnings after fresh install (new SDK downloader)
by J · in Torque Game Engine · 10/31/2004 (11:56 pm) · 4 replies
I had to download the new SDK installer today and reinstall the source. When making the first build of the testdemo I encounterd 2 warnings which I can not recall I had earlier. Both warnings are the same type and are probably totally harmless, but its always nicer to have no warning than 2 warnings, right? =)
The warnings are:
C:\Torque\SDK\engine\interior\pathedInterior.cc(143) : warning C4700: local variable 'pathPos' used without having been initialized
C:\Torque\SDK\engine\interior\pathedInterior.cc(301) : warning C4700: local variable 'pathPos' used without having been initialized
And the code that generated the warnings are:
Point3F pathPos;
//gClientPathManager->getPathPosition(mPathKey, 0, pathPos);
mOffset = initialPos - pathPos;
and
Point3F pathPos;
Point3F initialPos;
mBaseTransform.getColumn(3, &initialPos);
//gServerPathManager->getPathPosition(mPathKey, 0, pathPos);
mOffset = initialPos - pathPos;
So I decided to check out the constructor for the datatype used here:
inline Point3F::Point3F()
#if defined(TORQUE_OS_LINUX)
: x(0.f), y(0.f), z(0.f)
#endif
{
// Uninitialized points are definitely a problem.
// Enable the following code to see how often they crop up.
#ifdef DEBUG_MATH
*(U32 *)&x = 0x7FFFFFFA;
*(U32 *)&y = 0x7FFFFFFB;
*(U32 *)&z = 0x7FFFFFFC;
#endif
}
This was from what I could see the only constructor that took no arguments and the comment in the middle kind of worried me. I'm guessing that the data in this type would be set to 0,0,0 on creation by the compiler but you never know so I wanted to report this.
The warnings are:
C:\Torque\SDK\engine\interior\pathedInterior.cc(143) : warning C4700: local variable 'pathPos' used without having been initialized
C:\Torque\SDK\engine\interior\pathedInterior.cc(301) : warning C4700: local variable 'pathPos' used without having been initialized
And the code that generated the warnings are:
Point3F pathPos;
//gClientPathManager->getPathPosition(mPathKey, 0, pathPos);
mOffset = initialPos - pathPos;
and
Point3F pathPos;
Point3F initialPos;
mBaseTransform.getColumn(3, &initialPos);
//gServerPathManager->getPathPosition(mPathKey, 0, pathPos);
mOffset = initialPos - pathPos;
So I decided to check out the constructor for the datatype used here:
inline Point3F::Point3F()
#if defined(TORQUE_OS_LINUX)
: x(0.f), y(0.f), z(0.f)
#endif
{
// Uninitialized points are definitely a problem.
// Enable the following code to see how often they crop up.
#ifdef DEBUG_MATH
*(U32 *)&x = 0x7FFFFFFA;
*(U32 *)&y = 0x7FFFFFFB;
*(U32 *)&z = 0x7FFFFFFC;
#endif
}
This was from what I could see the only constructor that took no arguments and the comment in the middle kind of worried me. I'm guessing that the data in this type would be set to 0,0,0 on creation by the compiler but you never know so I wanted to report this.
#2
I'd blame it on a typo if it wasn't in multiple spots :P
And yes, it does compile and the demos (fps and racer) works.
I just wanted to point out that these exists in case they need fixing.
11/01/2004 (2:21 am)
Yes, ofcourse, warnings.I'd blame it on a typo if it wasn't in multiple spots :P
And yes, it does compile and the demos (fps and racer) works.
I just wanted to point out that these exists in case they need fixing.
#3
11/01/2004 (8:30 am)
Does anyone know why the two lines that would set the Point3Fs are commented out?
#4
11/01/2004 (9:21 am)
It's not in the build I'm running so it has to have changed recently, Ben.
Torque Owner Stefan Lundmark
I have not seen those with 1.3 CVS though..