Use #pragma warning(push) and pop to control our warnings

Using "default" means "reset to default compiler settings", not "revert
to command-line settings". And even if it did, it's possible some other
headers by the user toggled the settings. We shouldn't affect that.

Task-number: QTBUG-35622
Change-Id: If7c4bd0cc8c210f88ee89e3fa2dd3b7194ad77bb
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
bb10
Thiago Macieira 2013-12-14 10:20:26 -08:00 committed by The Qt Project
parent de61c78807
commit e6abf372c6
1 changed files with 2 additions and 1 deletions

View File

@ -327,6 +327,7 @@ inline void QImage::setPixel(const QPoint &pt, uint index_or_rgb) { setPixel(pt.
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wdeprecated-declarations"
#elif defined(Q_CC_MSVC)
# pragma warning(push)
# pragma warning(disable: 4996)
#endif
@ -403,7 +404,7 @@ inline void QImage::setText(const char* key, const char* lang, const QString &s)
#if defined(Q_CC_GNU) && !defined(Q_CC_INTEL) && (__GNUC__ * 100 + __GNUC_MINOR__ >= 406)
# pragma GCC diagnostic pop
#elif defined(Q_CC_MSVC)
# pragma warning(default: 4996)
# pragma warning(pop)
#endif
inline int QImage::numColors() const