]> git.mxchange.org Git - simgear.git/commitdiff
#581, invalid gcc pragma syntax
authorThorstenB <brehmt@gmail.com>
Mon, 9 Jan 2012 19:19:26 +0000 (20:19 +0100)
committerThorstenB <brehmt@gmail.com>
Mon, 9 Jan 2012 19:19:26 +0000 (20:19 +0100)
Thanks to Olaf Flebbe.

simgear/math/SGSphere.hxx

index 9806e9e89423dd0b4ac66b4886bfeb81fe039212..da0c641a310775366d3c0f6e25984b93c9f4f3fc 100644 (file)
 #ifndef SGSphere_H
 #define SGSphere_H
 
-#ifndef _MSC_VER
-#   pragma GCC diagnostic ignored "-Wuninitialized" SGSphere();
-#endif
 
 template<typename T>
 class SGSphere {
 public:
+
+#ifdef __GNUC__
+// Avoid "_center not initialized" warnings.
+#   pragma GCC diagnostic push
+#   pragma GCC diagnostic ignored "-Wuninitialized"
+#endif
+
   SGSphere() :
      /*
       * Do not initialize _center to save unneeded initialization time.
@@ -43,6 +47,11 @@ public:
     _radius(sphere.getRadius())
   { }
 
+#ifdef __GNUC__
+  // Restore warning settings.
+#   pragma GCC diagnostic pop
+#endif
+
   const SGVec3<T>& getCenter() const
   { return _center; }
   void setCenter(const SGVec3<T>& center)