Enable -pedantic and disable currently triggered warnings

This will help avoid the introduction of additional non-standard
code and the warnings can be reintroduced one by one.

Bug: dawn:394

Change-Id: Ib3cd63058f47d17ae5ef67b047887a3b263a7e64
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/20382
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
diff --git a/src/common/BUILD.gn b/src/common/BUILD.gn
index cbf27c5..4ef4b70 100644
--- a/src/common/BUILD.gn
+++ b/src/common/BUILD.gn
@@ -104,6 +104,25 @@
       "-Wstrict-prototypes",
       "-Wtautological-unsigned-zero-compare",
     ]
+
+    # clang-cl doesn't know -pedantic, pass it explicitly to the clang driver on Windows
+    if (is_win) {
+      cflags += [ "/clang:-pedantic" ]
+    } else {
+      cflags += [ "-pedantic" ]
+    }
+
+    # Flags for -pedantic warnings that haven't been fixed yet.
+    cflags += [
+      "-Wno-c++20-designator",
+      "-Wno-four-char-constants",
+      "-Wno-gnu-anonymous-struct",
+      "-Wno-gnu-zero-variadic-macro-arguments",
+      "-Wno-language-extension-token",
+      "-Wno-microsoft-enum-value",
+      "-Wno-nested-anon-types",
+      "-Wno-vla-extension",
+    ]
   }
 }