pw_presubmit: Disable broken, enable fixed

- The Bazel tests are not working; disable them.
- Fix remaining GCC compilation warning by avoiding a zero-length memcpy
  from a nullptr.

Bug: 255, 346

Change-Id: Icbff2edb910dbcd70d8a82ef667f3f09aeec30f4
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/44480
Commit-Queue: Wyatt Hepler <hepler@google.com>
Pigweed-Auto-Submit: Wyatt Hepler <hepler@google.com>
Reviewed-by: Rob Mohr <mohrr@google.com>
diff --git a/pw_kvs/public/pw_kvs/fake_flash_memory.h b/pw_kvs/public/pw_kvs/fake_flash_memory.h
index e892d92..49e36d7 100644
--- a/pw_kvs/public/pw_kvs/fake_flash_memory.h
+++ b/pw_kvs/public/pw_kvs/fake_flash_memory.h
@@ -154,12 +154,6 @@
   // Creates a flash memory with no data written.
   explicit FakeFlashMemoryBuffer(
       size_t alignment_bytes = kDefaultAlignmentBytes)
-      : FakeFlashMemoryBuffer(std::array<std::byte, 0>{}, alignment_bytes) {}
-
-  // Creates a flash memory initialized to the provided contents.
-  explicit FakeFlashMemoryBuffer(
-      std::span<const std::byte> contents,
-      size_t alignment_bytes = kDefaultAlignmentBytes)
       : FakeFlashMemory(buffer_,
                         kSectorSize,
                         kSectorCount,
@@ -167,6 +161,13 @@
                         read_errors_,
                         write_errors_) {
     std::memset(buffer_.data(), int(kErasedValue), buffer_.size());
+  }
+
+  // Creates a flash memory initialized to the provided contents.
+  explicit FakeFlashMemoryBuffer(
+      std::span<const std::byte> contents,
+      size_t alignment_bytes = kDefaultAlignmentBytes)
+      : FakeFlashMemoryBuffer(alignment_bytes) {
     std::memcpy(buffer_.data(),
                 contents.data(),
                 std::min(contents.size(), buffer_.size()));
diff --git a/pw_presubmit/py/pw_presubmit/pigweed_presubmit.py b/pw_presubmit/py/pw_presubmit/pigweed_presubmit.py
index 6f8f3cb..4e6676b 100755
--- a/pw_presubmit/py/pw_presubmit/pigweed_presubmit.py
+++ b/pw_presubmit/py/pw_presubmit/pigweed_presubmit.py
@@ -50,19 +50,7 @@
 
 
 def _at_all_optimization_levels(target):
-    levels = ('debug', 'size_optimized', 'speed_optimized')
-
-    # Skip optimized host GCC builds for now, since GCC sometimes emits spurious
-    # warnings.
-    #
-    #   -02: GCC 9.3 emits spurious maybe-uninitialized warnings
-    #   -0s: GCC 8.1 (Mingw-w64) emits a spurious nonnull warning
-    #
-    # TODO(pwbug/255): Enable optimized GCC builds when this is fixed.
-    if target == 'host_gcc':
-        levels = ('debug', )
-
-    for level in levels:
+    for level in ('debug', 'size_optimized', 'speed_optimized'):
         yield f'{target}_{level}'
 
 
@@ -596,7 +584,6 @@
     build.gn_gen(ctx.root, ctx.output_dir,
                  '--export-compile-commands=host_clang_debug')
     build.ninja(ctx.output_dir, 'host_clang_debug')
-
     compile_commands = ctx.output_dir.joinpath('compile_commands.json')
     analyzer_output = ctx.output_dir.joinpath('analyze-build-output')
 
@@ -639,6 +626,7 @@
     # Build that attempts to duplicate the build OSS-Fuzz does. Currently
     # failing.
     oss_fuzz_build,
+    # TODO(pwbug/346): Enable all Bazel tests when they're fixed.
     bazel_test,
     cmake_tests,
     gn_nanopb_build,
@@ -660,7 +648,6 @@
 
 QUICK = (
     LINTFORMAT,
-    bazel_test,
     gn_quick_build_check,
     # TODO(pwbug/141): Re-enable CMake and Bazel for Mac after we have fixed the
     # the clang issues. The problem is that all clang++ invocations need the
@@ -675,7 +662,6 @@
     gn_docs_build,
     gn_host_tools,
     bazel_build,
-    bazel_test,
     # On Mac OS, system 'gcc' is a symlink to 'clang' by default, so skip GCC
     # host builds on Mac for now. Skip it on Windows too, since gn_host_build
     # already uses 'gcc' on Windows.