From fddac2443dfb61fe291aa6102371e64aa31bb9e2 Mon Sep 17 00:00:00 2001 From: ThorstenB Date: Mon, 9 Jan 2012 21:49:34 +0100 Subject: [PATCH] More #pragma magic. Same magic as for SGSphere. --- simgear/math/SGVec3.hxx | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/simgear/math/SGVec3.hxx b/simgear/math/SGVec3.hxx index 64ceac0a..8483f92a 100644 --- a/simgear/math/SGVec3.hxx +++ b/simgear/math/SGVec3.hxx @@ -29,6 +29,12 @@ class SGVec3 { public: typedef T value_type; +#ifdef __GNUC__ +// Avoid "_data not initialized" warnings (see comment below). +# pragma GCC diagnostic push +# pragma GCC diagnostic ignored "-Wuninitialized" +#endif + /// Default constructor. Does not initialize at all. /// If you need them zero initialized, use SGVec3::zeros() SGVec3(void) @@ -41,6 +47,12 @@ public: data()[i] = SGLimits::quiet_NaN(); #endif } + +#ifdef __GNUC__ + // Restore warning settings. +# pragma GCC diagnostic pop +#endif + /// Constructor. Initialize by the given values SGVec3(T x, T y, T z) { data()[0] = x; data()[1] = y; data()[2] = z; }