File 0001-Fix-gcc-optimization-breaking-chromium.patch of Package libqt5-qtwebengine

From: Antonio Larrosa <alarrosa@suse.com>
Subject: Add -fno-delete-null-pointer-checks compiler option
References: https://gcc.gnu.org/gcc-6/porting_to.html#this-cannot-be-null
References: https://crbug.com/784492#c13

This is an excerpt of "Update Chromium to 64.0.3282.139" from upstream

diff --git a/src/3rdparty/chromium/build/config/compiler/BUILD.gn b/src/3rdparty/chromium/build/config/compiler/BUILD.gn
index 7888e2f858..fff8488778 100644
--- a/src/3rdparty/chromium/build/config/compiler/BUILD.gn
+++ b/src/3rdparty/chromium/build/config/compiler/BUILD.gn
@@ -1210,6 +1210,15 @@ config("default_warnings") {
       # Don't warn about "maybe" uninitialized. Clang doesn't include this
       # in -Wall but gcc does, and it gives false positives.
       cflags += [ "-Wno-maybe-uninitialized" ]
+      cflags += [ "-Wno-deprecated-declarations" ]
+
+      # GCC assumes 'this' is never nullptr and optimizes away code
+      # like "if (this == nullptr) ...": [1].  However, some Chromium
+      # code relies on these types of null pointer checks [2], so
+      # disable this optimization.
+      # [1] https://gcc.gnu.org/gcc-6/porting_to.html#this-cannot-be-null
+      # [2] https://crbug.com/784492#c13
+      cflags += [ "-fno-delete-null-pointer-checks" ]
     }
   }
 
openSUSE Build Service is sponsored by