James Kuszmaul | b13e13f | 2023-11-22 20:44:04 -0800 | [diff] [blame] | 1 | From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 |
| 2 | From: Peter Johnson <johnson.peter@gmail.com> |
| 3 | Date: Sat, 10 Jun 2023 15:59:45 -0700 |
Maxwell Henderson | 80bec32 | 2024-01-09 15:48:44 -0800 | [diff] [blame^] | 4 | Subject: [PATCH 07/12] Work around GCC 12 restrict warning compiler bug |
James Kuszmaul | b13e13f | 2023-11-22 20:44:04 -0800 | [diff] [blame] | 5 | |
| 6 | https://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 | |
| 11 | diff --git a/src/google/protobuf/io/tokenizer.cc b/src/google/protobuf/io/tokenizer.cc |
| 12 | index 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_; |