diff -Naur a/build/moz.configure/warnings.configure b/build/moz.configure/warnings.configure
--- a/build/moz.configure/warnings.configure	2022-10-10 19:05:25.000000000 +0300
+++ b/build/moz.configure/warnings.configure	2022-10-18 13:59:24.514026407 +0300
@@ -160,6 +160,9 @@
 # false positives depending on optimization
 check_and_add_warning("-Wno-error=array-bounds")
 
+# can't get rid of those PGO warnings
+check_and_add_warning("-Wno-error=coverage-mismatch")
+
 # false positives depending on optimizations
 check_and_add_warning("-Wno-error=free-nonheap-object")
 
@@ -279,8 +282,8 @@
         # build, but we're not sure why.
         check_and_add_warning("-Wno-enum-compare")
 
-# Make it an error to be missing function declarations for C code.
-check_and_add_warning("-Werror=implicit-function-declaration", c_compiler)
+check_and_add_warning("-Werror=implicit-function-declaration",
+                         when="--enable-warnings-as-errors")
 
 # New in clang 11. We can't really do anything about this warning.
 check_and_add_warning("-Wno-psabi")
