From: ThorstenB Date: Mon, 9 Jan 2012 21:18:17 +0000 (+0100) Subject: Alas. Fix #pragma magic for GCC <= 4.5. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=423eba373389684061fc0a8c7b78292f10011ed7;p=simgear.git Alas. Fix #pragma magic for GCC <= 4.5. push/pop was introduced for GCC4.6 only - so avoid it. Also, properly fix the fgets warning. --- diff --git a/simgear/math/SGSphere.hxx b/simgear/math/SGSphere.hxx index da0c641a..f46b7a0f 100644 --- a/simgear/math/SGSphere.hxx +++ b/simgear/math/SGSphere.hxx @@ -25,7 +25,6 @@ public: #ifdef __GNUC__ // Avoid "_center not initialized" warnings. -# pragma GCC diagnostic push # pragma GCC diagnostic ignored "-Wuninitialized" #endif @@ -49,7 +48,7 @@ public: #ifdef __GNUC__ // Restore warning settings. -# pragma GCC diagnostic pop +# pragma GCC diagnostic warning "-Wuninitialized" #endif const SGVec3& getCenter() const diff --git a/simgear/math/SGVec3.hxx b/simgear/math/SGVec3.hxx index 8483f92a..c85b418e 100644 --- a/simgear/math/SGVec3.hxx +++ b/simgear/math/SGVec3.hxx @@ -31,7 +31,6 @@ public: #ifdef __GNUC__ // Avoid "_data not initialized" warnings (see comment below). -# pragma GCC diagnostic push # pragma GCC diagnostic ignored "-Wuninitialized" #endif @@ -50,7 +49,7 @@ public: #ifdef __GNUC__ // Restore warning settings. -# pragma GCC diagnostic pop +# pragma GCC diagnostic warning "-Wuninitialized" #endif /// Constructor. Initialize by the given values diff --git a/simgear/timing/timezone.cxx b/simgear/timing/timezone.cxx index 3a8fa7fc..26174c75 100644 --- a/simgear/timing/timezone.cxx +++ b/simgear/timing/timezone.cxx @@ -143,7 +143,8 @@ SGTimeZoneContainer::SGTimeZoneContainer(const char *filename) errno = 0; while (1) { - (void) fgets(buffer, 256, infile); + if (0 == fgets(buffer, 256, infile)) + break; if (feof(infile)) { break; }