Remove warning suppressions and fix many casting bugs

This change removes most warning suppressions, in particular
from production code. In the past we inherit a bunch of -Wno-xxx
suppressions required to build gtest and libprotobuf headers.
Doing so, however, caused the suppressions to propagate back to
the translation units that were including any protobuf header
or any auto-generated .pb.h stub.
This change moves the gtest and probobuf header to be a
system include (-isystem vs -I). Doing so implicitly blacklists
any compiler warning on the headers.
This CL then re-enables warnings and deals with the fall out of
fixes that came out of this.

Bug: 77316877
Test: pefetto_unittests / perfetto_integrationtests
Change-Id: I3a01852ebf7d0b9bf19658ddf117209d129c70be
diff --git a/src/base/watchdog_posix.cc b/src/base/watchdog_posix.cc
index f757d77..9864e7b 100644
--- a/src/base/watchdog_posix.cc
+++ b/src/base/watchdog_posix.cc
@@ -94,7 +94,7 @@
   }
 }
 
-void Watchdog::SetMemoryLimit(uint32_t bytes, uint32_t window_ms) {
+void Watchdog::SetMemoryLimit(uint64_t bytes, uint32_t window_ms) {
   // Update the fields under the lock.
   std::lock_guard<std::mutex> guard(mutex_);
 
@@ -150,7 +150,7 @@
                &utime, &stime, &rss_pages) == 3);
 
     uint64_t cpu_time = utime + stime;
-    uint64_t rss_bytes = static_cast<uint32_t>(rss_pages) * base::kPageSize;
+    uint64_t rss_bytes = static_cast<uint64_t>(rss_pages) * base::kPageSize;
 
     CheckMemory(rss_bytes);
     CheckCpu(cpu_time);
@@ -167,7 +167,7 @@
     if (memory_window_bytes_.Mean() > memory_limit_bytes_) {
       PERFETTO_ELOG(
           "Memory watchdog trigger. Memory window of %f bytes is above the "
-          "%" PRIu32 " bytes limit.",
+          "%" PRIu64 " bytes limit.",
           memory_window_bytes_.Mean(), memory_limit_bytes_);
       kill(getpid(), SIGABRT);
     }