From: ThorstenB Date: Mon, 9 Jan 2012 20:49:34 +0000 (+0100) Subject: More #pragma magic. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=fddac2443dfb61fe291aa6102371e64aa31bb9e2;p=simgear.git More #pragma magic. Same magic as for SGSphere. --- 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; }