blob: 543896c2bc22154708a7e209d996c45180c81dbe [file] [log] [blame]
James Kuszmaulb13e13f2023-11-22 20:44:04 -08001From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2From: Peter Johnson <johnson.peter@gmail.com>
3Date: Sat, 10 Jun 2023 15:59:45 -0700
Maxwell Henderson80bec322024-01-09 15:48:44 -08004Subject: [PATCH 07/12] Work around GCC 12 restrict warning compiler bug
James Kuszmaulb13e13f2023-11-22 20:44:04 -08005
6https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105329
7---
8 src/google/protobuf/io/tokenizer.cc | 7 +++++++
9 1 file changed, 7 insertions(+)
10
11diff --git a/src/google/protobuf/io/tokenizer.cc b/src/google/protobuf/io/tokenizer.cc
12index f9e07763e7362bd37267619336db841d0ae9df25..30d62ac9647b897c2e7c8ad43cd27ff0e08922a2 100644
13--- a/src/google/protobuf/io/tokenizer.cc
14+++ b/src/google/protobuf/io/tokenizer.cc
15@@ -585,7 +585,14 @@ Tokenizer::NextCommentStatus Tokenizer::TryConsumeCommentStart() {
16 } else {
17 // Oops, it was just a slash. Return it.
18 current_.type = TYPE_SYMBOL;
19+#if defined(__GNUC__) && !defined(__clang__)
20+#pragma GCC diagnostic push
21+#pragma GCC diagnostic ignored "-Wrestrict"
22+#endif
23 current_.text = "/";
24+#if defined(__GNUC__) && !defined(__clang__)
25+#pragma GCC diagnostic pop
26+#endif
27 current_.line = line_;
28 current_.column = column_ - 1;
29 current_.end_column = column_;