Commit 8e636ea6806ab5d1f1d05bafd0a192dad06d42b6

Authored by Jay Berkenbilt
1 parent e8ddac89

Protect gcc diagnostic pragmas with gcc version

Versions prior to 4.6 didn't allow gcc diagnostic pragmas with push
and pop and to appear anywhere in the file.  Just let the warning be
there for those versions.
Showing 1 changed file with 4 additions and 0 deletions
libqpdf/Pl_Flate.cc
... ... @@ -77,8 +77,10 @@ Pl_Flate::handleData(unsigned char* data, int len, int flush)
77 77 // deflateInit and inflateInit are macros that use old-style
78 78 // casts.
79 79 #ifdef __GNUC__
  80 +# if ((__GNUC__ * 100) + __GNUC_MINOR__) >= 406
80 81 # pragma GCC diagnostic push
81 82 # pragma GCC diagnostic ignored "-Wold-style-cast"
  83 +# endif
82 84 #endif
83 85 if (this->action == a_deflate)
84 86 {
... ... @@ -89,7 +91,9 @@ Pl_Flate::handleData(unsigned char* data, int len, int flush)
89 91 err = inflateInit(&zstream);
90 92 }
91 93 #ifdef __GNUC__
  94 +# if ((__GNUC__ * 100) + __GNUC_MINOR__) >= 406
92 95 # pragma GCC diagnostic pop
  96 +# endif
93 97 #endif
94 98  
95 99 checkError("Init", err);
... ...