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.
This commit is contained in:
ThorstenB 2012-01-09 22:18:17 +01:00
parent 49a23fdc2e
commit 423eba3733
3 changed files with 4 additions and 5 deletions

View File

@ -25,7 +25,6 @@ public:
#ifdef __GNUC__ #ifdef __GNUC__
// Avoid "_center not initialized" warnings. // Avoid "_center not initialized" warnings.
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wuninitialized" # pragma GCC diagnostic ignored "-Wuninitialized"
#endif #endif
@ -49,7 +48,7 @@ public:
#ifdef __GNUC__ #ifdef __GNUC__
// Restore warning settings. // Restore warning settings.
# pragma GCC diagnostic pop # pragma GCC diagnostic warning "-Wuninitialized"
#endif #endif
const SGVec3<T>& getCenter() const const SGVec3<T>& getCenter() const

View File

@ -31,7 +31,6 @@ public:
#ifdef __GNUC__ #ifdef __GNUC__
// Avoid "_data not initialized" warnings (see comment below). // Avoid "_data not initialized" warnings (see comment below).
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wuninitialized" # pragma GCC diagnostic ignored "-Wuninitialized"
#endif #endif
@ -50,7 +49,7 @@ public:
#ifdef __GNUC__ #ifdef __GNUC__
// Restore warning settings. // Restore warning settings.
# pragma GCC diagnostic pop # pragma GCC diagnostic warning "-Wuninitialized"
#endif #endif
/// Constructor. Initialize by the given values /// Constructor. Initialize by the given values

View File

@ -143,7 +143,8 @@ SGTimeZoneContainer::SGTimeZoneContainer(const char *filename)
errno = 0; errno = 0;
while (1) { while (1) {
(void) fgets(buffer, 256, infile); if (0 == fgets(buffer, 256, infile))
break;
if (feof(infile)) { if (feof(infile)) {
break; break;
} }