Skip to content

Commit

Permalink
Update protobuf patches
Browse files Browse the repository at this point in the history
  • Loading branch information
PeterJohnson committed Nov 23, 2023
1 parent 16f54dd commit 2145828
Show file tree
Hide file tree
Showing 14 changed files with 43 additions and 12 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Peter Johnson <johnson.peter@gmail.com>
Date: Sat, 10 Jun 2023 14:13:07 -0700
Subject: [PATCH 01/12] Fix sign-compare warnings
Subject: [PATCH 01/13] Fix sign-compare warnings

---
src/google/protobuf/compiler/importer.cc | 2 +-
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Peter Johnson <johnson.peter@gmail.com>
Date: Sat, 10 Jun 2023 14:41:39 -0700
Subject: [PATCH 02/12] Remove redundant move
Subject: [PATCH 02/13] Remove redundant move

---
src/google/protobuf/extension_set.h | 2 +-
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Peter Johnson <johnson.peter@gmail.com>
Date: Sat, 10 Jun 2023 15:00:20 -0700
Subject: [PATCH 03/12] Fix maybe-uninitialized warnings
Subject: [PATCH 03/13] Fix maybe-uninitialized warnings

---
src/google/protobuf/arena.cc | 6 +++---
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Peter Johnson <johnson.peter@gmail.com>
Date: Sat, 10 Jun 2023 15:03:38 -0700
Subject: [PATCH 04/12] Fix coded_stream WriteRaw
Subject: [PATCH 04/13] Fix coded_stream WriteRaw

---
src/google/protobuf/implicit_weak_message.h | 2 +-
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Peter Johnson <johnson.peter@gmail.com>
Date: Sat, 10 Jun 2023 15:13:45 -0700
Subject: [PATCH 05/12] Suppress enum-enum conversion warning
Subject: [PATCH 05/13] Suppress enum-enum conversion warning

---
src/google/protobuf/generated_message_tctable_impl.h | 9 +++++++++
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Peter Johnson <johnson.peter@gmail.com>
Date: Sat, 10 Jun 2023 15:16:46 -0700
Subject: [PATCH 06/12] Fix noreturn function returning
Subject: [PATCH 06/13] Fix noreturn function returning

---
src/google/protobuf/generated_message_tctable_impl.h | 3 +++
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Peter Johnson <johnson.peter@gmail.com>
Date: Sat, 10 Jun 2023 15:59:45 -0700
Subject: [PATCH 07/12] Work around GCC 12 restrict warning compiler bug
Subject: [PATCH 07/13] Work around GCC 12 restrict warning compiler bug

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105329
---
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Peter Johnson <johnson.peter@gmail.com>
Date: Tue, 13 Jun 2023 23:56:15 -0700
Subject: [PATCH 08/12] Disable MSVC switch warning
Subject: [PATCH 08/13] Disable MSVC switch warning

---
src/google/protobuf/generated_message_reflection.cc | 4 ++++
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Peter Johnson <johnson.peter@gmail.com>
Date: Tue, 13 Jun 2023 23:58:50 -0700
Subject: [PATCH 09/12] Disable unused function warning
Subject: [PATCH 09/13] Disable unused function warning

---
src/google/protobuf/generated_message_tctable_lite.cc | 4 ++++
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Peter Johnson <johnson.peter@gmail.com>
Date: Wed, 14 Jun 2023 00:02:26 -0700
Subject: [PATCH 10/12] Disable pedantic warning
Subject: [PATCH 10/13] Disable pedantic warning

---
src/google/protobuf/descriptor.h | 8 ++++++++
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Peter Johnson <johnson.peter@gmail.com>
Date: Mon, 9 Oct 2023 19:28:08 -0700
Subject: [PATCH 11/12] Avoid use of sprintf
Subject: [PATCH 11/13] Avoid use of sprintf

---
src/google/protobuf/stubs/strutil.cc | 14 +++++++++++---
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Tyler Veness <calcmogul@gmail.com>
Date: Fri, 10 Nov 2023 14:17:53 -0800
Subject: [PATCH 12/12] Suppress stringop-overflow warning false positives
Subject: [PATCH 12/13] Suppress stringop-overflow warning false positives

---
src/google/protobuf/io/coded_stream.h | 7 +++++++
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Peter Johnson <johnson.peter@gmail.com>
Date: Thu, 23 Nov 2023 10:32:59 -0800
Subject: [PATCH 13/13] Include WPI SymbolExports

Also suppress 4275 warning on MSVC.

This is needed to enable WPILIB_DLLEXPORT from wpimath.
---
src/google/protobuf/port_def.inc | 7 +++++++
1 file changed, 7 insertions(+)

diff --git a/src/google/protobuf/port_def.inc b/src/google/protobuf/port_def.inc
index 6c6aa1834b0cbf38b16660e6231f24da72157306..dd1798ce8b3806efb26187f4cb91b209498af2f8 100644
--- a/src/google/protobuf/port_def.inc
+++ b/src/google/protobuf/port_def.inc
@@ -48,6 +48,13 @@
// detect/prohibit anytime it is #included twice without a corresponding
// #undef.

+#if __has_include("wpi/SymbolExports.h")
+#include "wpi/SymbolExports.h"
+#ifdef _MSC_VER
+#pragma warning(disable : 4275)
+#endif
+#endif
+
// The definitions in this file are intended to be portable across Clang,
// GCC, and MSVC. Function-like macros are usable without an #ifdef guard.
// Syntax macros (for example, attributes) are always defined, although
1 change: 1 addition & 0 deletions upstream_utils/update_protobuf.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,7 @@ def main():
"0010-Disable-pedantic-warning.patch",
"0011-Avoid-use-of-sprintf.patch",
"0012-Suppress-stringop-overflow-warning-false-positives.patch",
"0013-Include-WPI-SymbolExports.patch",
]:
git_am(os.path.join(wpilib_root, "upstream_utils/protobuf_patches", f))

Expand Down

0 comments on commit 2145828

Please sign in to comment.