I'm seeing lots of warnings when building simgear/sky/clouds3d/ , and when I use the GCC option "-pedantic" it gives errors and doesn't build at all. This is with GCC 3.2 on SUSE 8.1; PLIB and SimGear both from CVS today.

(Why do I bother mentioning this? I'm a firm believer in using compiler warnings to help find mistakes. When I compile my code I enjoy looking at each warning and considering whether the compiler is justified in its opinion or not. I accept that one sometimes has to change perfectly good code to get rid of some of the over-zealous warnings. And I use -pedantic (as well as -Wall) in these projects because it helps portability, despite what "man gcc" says about it.)

The attached patch makes a start by fixing a quarter of the easy ones for GCC. Perhaps someone could check that that's OK with MSVC (and GCC 2.95 perhaps) before applying it (or sending it to the originator, if he is still interested in maintaining it).

- Julian

Index: SkyBVTree.hpp
===================================================================
RCS file: /var/cvs/SimGear-0.3/SimGear/simgear/sky/clouds3d/SkyBVTree.hpp,v
retrieving revision 1.2
diff -u -3 -p -d -r1.2 SkyBVTree.hpp
--- SkyBVTree.hpp       14 Sep 2002 16:03:39 -0000      1.2
+++ SkyBVTree.hpp       27 Oct 2002 02:38:03 -0000
@@ -214,9 +214,9 @@ class SkyBVTree : public SkyBaseBVTree<O
 {
 public:
   typedef SkyBaseBVTree<Object, BoundingVolume> BaseTree;
-  typedef BaseTree::BV BV;
-  typedef BaseTree::NodeObject NodeObject;
-  typedef BaseTree::Node Node;
+  typedef typename BaseTree::BV BV;
+  typedef typename BaseTree::NodeObject NodeObject;
+  typedef typename BaseTree::Node Node;
   
   void Clear()
   {
Index: SkyBVTreeSplitter.hpp
===================================================================
RCS file: /var/cvs/SimGear-0.3/SimGear/simgear/sky/clouds3d/SkyBVTreeSplitter.hpp,v
retrieving revision 1.2
diff -u -3 -p -d -r1.2 SkyBVTreeSplitter.hpp
--- SkyBVTreeSplitter.hpp       14 Sep 2002 16:03:39 -0000      1.2
+++ SkyBVTreeSplitter.hpp       27 Oct 2002 02:38:04 -0000
@@ -52,7 +52,7 @@ template<class Object>
 class SkyBoundingBoxSplitter
 {
 public:
-       typedef SkyBaseBVTree<Object, SkyMinMaxBox>::NodeObject NodeObjectBox;
+       typedef typename SkyBaseBVTree<Object, SkyMinMaxBox>::NodeObject NodeObjectBox;
        //typedef SkyBaseBVTree<Object, SkyBoundingSphere>::NodeObject 
NodeObjectSphere;
 
 #if _MSC_VER == 1200
@@ -183,7 +183,7 @@ class SkyAABBTreeSplitter
 {
 public:
        typedef SkyMinMaxBox BV;
-       typedef SkyBaseBVTree<Object, BV>::NodeObject NodeObject;
+       typedef typename SkyBaseBVTree<Object, BV>::NodeObject NodeObject;
 
        SkyAABBTreeSplitter(const NodeObject* pObjs, unsigned int iNumObjs) : 
_splitter(pObjs, iNumObjs) {}
 
Index: SkyCloud.cpp
===================================================================
RCS file: /var/cvs/SimGear-0.3/SimGear/simgear/sky/clouds3d/SkyCloud.cpp,v
retrieving revision 1.7
diff -u -3 -p -d -r1.7 SkyCloud.cpp
--- SkyCloud.cpp        4 Oct 2002 16:44:23 -0000       1.7
+++ SkyCloud.cpp        27 Oct 2002 02:38:10 -0000
@@ -23,7 +23,9 @@
  */
 
 // warning for truncation of template name for browse info
+#ifdef _MSC_VER
 #pragma warning( disable : 4786)
+#endif
 
 #include "SkyCloud.hpp"
 #include "SkyRenderableInstance.hpp" 
Index: SkyCloud.hpp
===================================================================
RCS file: /var/cvs/SimGear-0.3/SimGear/simgear/sky/clouds3d/SkyCloud.hpp,v
retrieving revision 1.4
diff -u -3 -p -d -r1.4 SkyCloud.hpp
--- SkyCloud.hpp        3 Oct 2002 02:52:56 -0000       1.4
+++ SkyCloud.hpp        27 Oct 2002 02:38:11 -0000
@@ -24,7 +24,9 @@
 #define __SKYCLOUD_HPP__
 
 // warning for truncation of template name for browse info
+#ifdef _MSC_VER
 #pragma warning( disable : 4786)
+#endif
 
 #include "SkyCloudParticle.hpp"
 #include "SkyRenderable.hpp"
Index: SkyDynamicTextureManager.cpp
===================================================================
RCS file: 
/var/cvs/SimGear-0.3/SimGear/simgear/sky/clouds3d/SkyDynamicTextureManager.cpp,v
retrieving revision 1.1
diff -u -3 -p -d -r1.1 SkyDynamicTextureManager.cpp
--- SkyDynamicTextureManager.cpp        13 Sep 2002 20:29:04 -0000      1.1
+++ SkyDynamicTextureManager.cpp        27 Oct 2002 02:38:13 -0000
@@ -21,13 +21,13 @@
  * Implementation of a repository for check out and check in of dynamic textures.
  */
 
+#ifdef _MSC_VER
 #pragma warning( disable : 4786 )
+#endif
 
 #include "SkyDynamicTextureManager.hpp"
 #include "SkyTexture.hpp"
 #include "SkyContext.hpp"
-
-#pragma warning( disable : 4786 )
 
 //! Set this to 1 to print lots of dynamic texture usage messages.
 #define SKYDYNTEXTURE_VERBOSE        0
Index: SkyDynamicTextureManager.hpp
===================================================================
RCS file: 
/var/cvs/SimGear-0.3/SimGear/simgear/sky/clouds3d/SkyDynamicTextureManager.hpp,v
retrieving revision 1.2
diff -u -3 -p -d -r1.2 SkyDynamicTextureManager.hpp
--- SkyDynamicTextureManager.hpp        14 Sep 2002 16:03:39 -0000      1.2
+++ SkyDynamicTextureManager.hpp        27 Oct 2002 02:38:14 -0000
@@ -24,7 +24,9 @@
 #define __SKYDYNAMICTEXTUREMANAGER_HPP__
   
 // warning for truncation of template name for browse info
+#ifdef _MSC_VER
 #pragma warning( disable : 4786)
+#endif
 
 #include <map>
 #include <GL/glut.h>
Index: SkyLight.cpp
===================================================================
RCS file: /var/cvs/SimGear-0.3/SimGear/simgear/sky/clouds3d/SkyLight.cpp,v
retrieving revision 1.4
diff -u -3 -p -d -r1.4 SkyLight.cpp
--- SkyLight.cpp        18 Sep 2002 14:24:19 -0000      1.4
+++ SkyLight.cpp        27 Oct 2002 02:38:15 -0000
@@ -160,7 +160,7 @@ void SkyLight::Display() const
         mat.invLookAt(vecPos + 50 * vecDir, vecPos + 51 * vecDir, vecUp);
 
         glMultMatrixf(mat);   
-        float rAlpha= acos(pow(10, (-12 / _rSpotExponent)));
+        //float rAlpha= acos(pow(10, (-12 / _rSpotExponent)));
         //glutWireCone(50 * tan(SKYDEGREESTORADS * rAlpha), 50, 16, 8);
         glutWireCone(50 * tan(SKYDEGREESTORADS * _rSpotCutoff), 50, 16, 8);
       }
Index: SkyRenderable.hpp
===================================================================
RCS file: /var/cvs/SimGear-0.3/SimGear/simgear/sky/clouds3d/SkyRenderable.hpp,v
retrieving revision 1.2
diff -u -3 -p -d -r1.2 SkyRenderable.hpp
--- SkyRenderable.hpp   14 Sep 2002 16:03:39 -0000      1.2
+++ SkyRenderable.hpp   27 Oct 2002 02:38:15 -0000
@@ -28,7 +28,9 @@
 #ifndef __SKYRENDERABLE_HPP__
 #define __SKYRENDERABLE_HPP__
 
+#ifdef _MSC_VER
 #pragma warning( disable : 4786)
+#endif
 
 #include <string>
 
Index: SkyRenderableInstanceGroup.cpp
===================================================================
RCS file: 
/var/cvs/SimGear-0.3/SimGear/simgear/sky/clouds3d/SkyRenderableInstanceGroup.cpp,v
retrieving revision 1.3
diff -u -3 -p -d -r1.3 SkyRenderableInstanceGroup.cpp
--- SkyRenderableInstanceGroup.cpp      18 Sep 2002 14:24:19 -0000      1.3
+++ SkyRenderableInstanceGroup.cpp      27 Oct 2002 02:38:16 -0000
@@ -104,8 +104,8 @@ SKYRESULT SkyRenderableInstanceGroup::Di
   glPushMatrix();
   glMultMatrixf(mat.M);
 
-  InstanceIterator ii;
   /***
+  InstanceIterator ii;
   for (ii = _opaqueSubInstances.begin(); ii != _opaqueSubInstances.end(); ++ii)
   {
     FAIL_RETURN((*ii)->Display());
Index: SkySceneManager.cpp
===================================================================
RCS file: /var/cvs/SimGear-0.3/SimGear/simgear/sky/clouds3d/SkySceneManager.cpp,v
retrieving revision 1.7
diff -u -3 -p -d -r1.7 SkySceneManager.cpp
--- SkySceneManager.cpp 3 Oct 2002 18:44:34 -0000       1.7
+++ SkySceneManager.cpp 27 Oct 2002 02:38:21 -0000
@@ -24,7 +24,9 @@
  */
 
 // warning for truncation of template name for browse info
+#ifdef _MSC_VER
 #pragma warning( disable : 4786)
+#endif
 
 #include "SkySceneManager.hpp"
 #include "SkyMaterial.hpp"
Index: SkySceneManager.hpp
===================================================================
RCS file: /var/cvs/SimGear-0.3/SimGear/simgear/sky/clouds3d/SkySceneManager.hpp,v
retrieving revision 1.3
diff -u -3 -p -d -r1.3 SkySceneManager.hpp
--- SkySceneManager.hpp 3 Oct 2002 02:52:56 -0000       1.3
+++ SkySceneManager.hpp 27 Oct 2002 02:38:22 -0000
@@ -27,7 +27,9 @@
 #define __SKYSCENEMANAGER_HPP__
 
 // warning for truncation of template name for browse info
+#ifdef _MSC_VER
 #pragma warning( disable : 4786)
+#endif
 
 #include "vec3f.hpp"
 #include <vector>
Index: SkyTextureManager.cpp
===================================================================
RCS file: /var/cvs/SimGear-0.3/SimGear/simgear/sky/clouds3d/SkyTextureManager.cpp,v
retrieving revision 1.5
diff -u -3 -p -d -r1.5 SkyTextureManager.cpp
--- SkyTextureManager.cpp       18 Oct 2002 20:25:21 -0000      1.5
+++ SkyTextureManager.cpp       27 Oct 2002 02:38:26 -0000
@@ -20,7 +20,9 @@
  * Implementation of a manager that keeps track of texture resource locations and 
sharing.
  */
 
+#ifdef _MSC_VER
 #pragma warning( disable : 4786)
+#endif
 
 #include "SkyTextureManager.hpp"
 #include "SkyContext.hpp"


Reply via email to