| 1 |
From https://chromium-review.googlesource.com/c/chromium/src/+/6445471 |
| 2 |
|
| 3 |
Don't apply /*FALLTHROUGH*/ edit to gperf 3.2 output |
| 4 |
|
| 5 |
The gperf issue at https://savannah.gnu.org/bugs/index.php?53029 |
| 6 |
has been resolved as of the 3.2 release, and not only is the |
| 7 |
/*FALLTHROUGH*/ comment replacement no longer needed, it now |
| 8 |
breaks the build with "error: fallthrough annotation does not |
| 9 |
directly precede switch label". Only do the edit for 3.1. |
| 10 |
|
| 11 |
--- src/3rdparty/chromium/third_party/blink/renderer/build/scripts/gperf.py |
| 12 |
+++ src/3rdparty/chromium/third_party/blink/renderer/build/scripts/gperf.py |
| 13 |
@@ -35,10 +35,11 @@ def generate_gperf(gperf_path, gperf_input, gperf_args): |
| 14 |
# https://savannah.gnu.org/bugs/index.php?53028 |
| 15 |
gperf_output = re.sub(r'\bregister ', '', gperf_output) |
| 16 |
# -Wimplicit-fallthrough needs an explicit fallthrough statement, |
| 17 |
- # so replace gperf's /*FALLTHROUGH*/ comment with the statement. |
| 18 |
- # https://savannah.gnu.org/bugs/index.php?53029 |
| 19 |
- gperf_output = gperf_output.replace('/*FALLTHROUGH*/', |
| 20 |
- ' [[fallthrough]];') |
| 21 |
+ # so replace gperf 3.1's /*FALLTHROUGH*/ comment with the statement. |
| 22 |
+ # https://savannah.gnu.org/bugs/index.php?53029 (fixed in 3.2) |
| 23 |
+ if '/* C++ code produced by gperf version 3.1 */' in gperf_output: |
| 24 |
+ gperf_output = gperf_output.replace('/*FALLTHROUGH*/', |
| 25 |
+ ' [[fallthrough]];') |
| 26 |
# -Wpointer-to-int-cast warns about casting pointers to smaller ints |
| 27 |
# Replace {(int)(long)&(foo), bar} with |
| 28 |
# {static_cast<int>(reinterpret_cast<uintptr_t>(&(foo)), bar} |