Bug 1621518 - Fix build errors with -Werror=format-security with GCC. r=jgilbert

Differential Revision: https://phabricator.services.mozilla.com/D66355

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Mike Hommey 2020-03-11 03:30:11 +00:00
parent 5abcf032b5
commit 082a30140e
2 changed files with 15 additions and 0 deletions

View File

@ -826,10 +826,15 @@ class ClientWebGLContext final : public nsICanvasRenderingContextInternal,
#ifdef __clang__
# pragma clang diagnostic push
# pragma clang diagnostic ignored "-Wformat-security"
#elif defined(__GNUC__)
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wformat-security"
#endif
text.AppendPrintf(format, args...);
#ifdef __clang__
# pragma clang diagnostic pop
#elif defined(__GNUC__)
# pragma GCC diagnostic pop
#endif
EnqueueErrorImpl(error, text);

View File

@ -398,10 +398,15 @@ class WebGLContext : public VRefCounted, public SupportsWeakPtr<WebGLContext> {
#ifdef __clang__
# pragma clang diagnostic push
# pragma clang diagnostic ignored "-Wformat-security"
#elif defined(__GNUC__)
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wformat-security"
#endif
text.AppendPrintf(fmt, args...);
#ifdef __clang__
# pragma clang diagnostic pop
#elif defined(__GNUC__)
# pragma GCC diagnostic pop
#endif
GenerateErrorImpl(err, text);
@ -1245,10 +1250,15 @@ class WebGLContext : public VRefCounted, public SupportsWeakPtr<WebGLContext> {
#ifdef __clang__
# pragma clang diagnostic push
# pragma clang diagnostic ignored "-Wformat-security"
#elif defined(__GNUC__)
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wformat-security"
#endif
msg.AppendPrintf(fmt, args...);
#ifdef __clang__
# pragma clang diagnostic pop
#elif defined(__GNUC__)
# pragma GCC diagnostic pop
#endif
GenerateErrorImpl(0, msg);