]> git.sesse.net Git - ffmpeg/commitdiff
Avoid corrupting diagnostic state with _Pragma changes.
authorDale Curtis <dalecurtis@chromium.org>
Sat, 4 Nov 2017 00:10:55 +0000 (17:10 -0700)
committerMichael Niedermayer <michael@niedermayer.cc>
Tue, 14 Nov 2017 19:49:07 +0000 (20:49 +0100)
The macros for ICC and MSVC correctly push and pop the diagnostic
state of the compiler when disabling deprecation warnings. The
ones for clang/gcc should do the same. Without this, if a blanket
deprecation warning is applied to the code base it'll be flipped
back on incorrectly with FF_ENABLE_DEPRECATION_WARNINGS.

Signed-off-by: Dale Curtis <dalecurtis@chromium.org>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavutil/internal.h

index fef5089097ec82cc39d25e56b0c105d311def2d7..72ae0ad89b2bc75f0645aceb95adae5160b99267 100644 (file)
@@ -81,8 +81,8 @@
 #        define FF_DISABLE_DEPRECATION_WARNINGS __pragma(warning(push)) __pragma(warning(disable:4996))
 #        define FF_ENABLE_DEPRECATION_WARNINGS  __pragma(warning(pop))
 #    else
-#        define FF_DISABLE_DEPRECATION_WARNINGS _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"")
-#        define FF_ENABLE_DEPRECATION_WARNINGS  _Pragma("GCC diagnostic warning \"-Wdeprecated-declarations\"")
+#        define FF_DISABLE_DEPRECATION_WARNINGS _Pragma("GCC diagnostic push") _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"")
+#        define FF_ENABLE_DEPRECATION_WARNINGS  _Pragma("GCC diagnostic pop")
 #    endif
 #else
 #    define FF_DISABLE_DEPRECATION_WARNINGS