diff --git a/upstream_utils/protobuf_patches/0001-Fix-sign-compare-warnings.patch b/upstream_utils/protobuf_patches/0001-Fix-sign-compare-warnings.patch index d3ac55c09d4..123b23c4e1b 100644 --- a/upstream_utils/protobuf_patches/0001-Fix-sign-compare-warnings.patch +++ b/upstream_utils/protobuf_patches/0001-Fix-sign-compare-warnings.patch @@ -1,7 +1,7 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Peter Johnson 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 +- diff --git a/upstream_utils/protobuf_patches/0002-Remove-redundant-move.patch b/upstream_utils/protobuf_patches/0002-Remove-redundant-move.patch index 6916c98bd29..70288208588 100644 --- a/upstream_utils/protobuf_patches/0002-Remove-redundant-move.patch +++ b/upstream_utils/protobuf_patches/0002-Remove-redundant-move.patch @@ -1,7 +1,7 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Peter Johnson 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 +- diff --git a/upstream_utils/protobuf_patches/0003-Fix-maybe-uninitialized-warnings.patch b/upstream_utils/protobuf_patches/0003-Fix-maybe-uninitialized-warnings.patch index 6888dd25eef..1f54467220d 100644 --- a/upstream_utils/protobuf_patches/0003-Fix-maybe-uninitialized-warnings.patch +++ b/upstream_utils/protobuf_patches/0003-Fix-maybe-uninitialized-warnings.patch @@ -1,7 +1,7 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Peter Johnson 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 +++--- diff --git a/upstream_utils/protobuf_patches/0004-Fix-coded_stream-WriteRaw.patch b/upstream_utils/protobuf_patches/0004-Fix-coded_stream-WriteRaw.patch index dc17497b7be..e1649137559 100644 --- a/upstream_utils/protobuf_patches/0004-Fix-coded_stream-WriteRaw.patch +++ b/upstream_utils/protobuf_patches/0004-Fix-coded_stream-WriteRaw.patch @@ -1,7 +1,7 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Peter Johnson 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 +- diff --git a/upstream_utils/protobuf_patches/0005-Suppress-enum-enum-conversion-warning.patch b/upstream_utils/protobuf_patches/0005-Suppress-enum-enum-conversion-warning.patch index 2919644e3ef..84712afc3b8 100644 --- a/upstream_utils/protobuf_patches/0005-Suppress-enum-enum-conversion-warning.patch +++ b/upstream_utils/protobuf_patches/0005-Suppress-enum-enum-conversion-warning.patch @@ -1,7 +1,7 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Peter Johnson 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 +++++++++ diff --git a/upstream_utils/protobuf_patches/0006-Fix-noreturn-function-returning.patch b/upstream_utils/protobuf_patches/0006-Fix-noreturn-function-returning.patch index abaa0a20b9e..70841fe6532 100644 --- a/upstream_utils/protobuf_patches/0006-Fix-noreturn-function-returning.patch +++ b/upstream_utils/protobuf_patches/0006-Fix-noreturn-function-returning.patch @@ -1,7 +1,7 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Peter Johnson 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 +++ diff --git a/upstream_utils/protobuf_patches/0007-Work-around-GCC-12-restrict-warning-compiler-bug.patch b/upstream_utils/protobuf_patches/0007-Work-around-GCC-12-restrict-warning-compiler-bug.patch index 543896c2bc2..0f1a050190a 100644 --- a/upstream_utils/protobuf_patches/0007-Work-around-GCC-12-restrict-warning-compiler-bug.patch +++ b/upstream_utils/protobuf_patches/0007-Work-around-GCC-12-restrict-warning-compiler-bug.patch @@ -1,7 +1,7 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Peter Johnson 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 --- diff --git a/upstream_utils/protobuf_patches/0008-Disable-MSVC-switch-warning.patch b/upstream_utils/protobuf_patches/0008-Disable-MSVC-switch-warning.patch index 92654f0ff67..716a28f8c75 100644 --- a/upstream_utils/protobuf_patches/0008-Disable-MSVC-switch-warning.patch +++ b/upstream_utils/protobuf_patches/0008-Disable-MSVC-switch-warning.patch @@ -1,7 +1,7 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Peter Johnson 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 ++++ diff --git a/upstream_utils/protobuf_patches/0009-Disable-unused-function-warning.patch b/upstream_utils/protobuf_patches/0009-Disable-unused-function-warning.patch index 9a8864951c6..7c427f11f83 100644 --- a/upstream_utils/protobuf_patches/0009-Disable-unused-function-warning.patch +++ b/upstream_utils/protobuf_patches/0009-Disable-unused-function-warning.patch @@ -1,7 +1,7 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Peter Johnson 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 ++++ diff --git a/upstream_utils/protobuf_patches/0010-Disable-pedantic-warning.patch b/upstream_utils/protobuf_patches/0010-Disable-pedantic-warning.patch index dd1860e79d4..5ae5a9c5b6d 100644 --- a/upstream_utils/protobuf_patches/0010-Disable-pedantic-warning.patch +++ b/upstream_utils/protobuf_patches/0010-Disable-pedantic-warning.patch @@ -1,7 +1,7 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Peter Johnson 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 ++++++++ diff --git a/upstream_utils/protobuf_patches/0011-Avoid-use-of-sprintf.patch b/upstream_utils/protobuf_patches/0011-Avoid-use-of-sprintf.patch index a0dfad86555..2d5692ccf76 100644 --- a/upstream_utils/protobuf_patches/0011-Avoid-use-of-sprintf.patch +++ b/upstream_utils/protobuf_patches/0011-Avoid-use-of-sprintf.patch @@ -1,7 +1,7 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Peter Johnson 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 +++++++++++--- diff --git a/upstream_utils/protobuf_patches/0012-Suppress-stringop-overflow-warning-false-positives.patch b/upstream_utils/protobuf_patches/0012-Suppress-stringop-overflow-warning-false-positives.patch index 929c117fce6..809bb24a75d 100644 --- a/upstream_utils/protobuf_patches/0012-Suppress-stringop-overflow-warning-false-positives.patch +++ b/upstream_utils/protobuf_patches/0012-Suppress-stringop-overflow-warning-false-positives.patch @@ -1,7 +1,7 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Tyler Veness 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 +++++++ diff --git a/upstream_utils/protobuf_patches/0013-Include-WPI-SymbolExports.patch b/upstream_utils/protobuf_patches/0013-Include-WPI-SymbolExports.patch new file mode 100644 index 00000000000..d8c2c0f8221 --- /dev/null +++ b/upstream_utils/protobuf_patches/0013-Include-WPI-SymbolExports.patch @@ -0,0 +1,30 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Peter Johnson +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 diff --git a/upstream_utils/update_protobuf.py b/upstream_utils/update_protobuf.py index 1f004cd0c42..2579cdcbe56 100755 --- a/upstream_utils/update_protobuf.py +++ b/upstream_utils/update_protobuf.py @@ -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))