From https://chromium-review.googlesource.com/c/chromium/src/+/6445471 Don't apply /*FALLTHROUGH*/ edit to gperf 3.2 output The gperf issue at https://savannah.gnu.org/bugs/index.php?53029 has been resolved as of the 3.2 release, and not only is the /*FALLTHROUGH*/ comment replacement no longer needed, it now breaks the build with "error: fallthrough annotation does not directly precede switch label". Only do the edit for 3.1. --- src/3rdparty/chromium/third_party/blink/renderer/build/scripts/gperf.py +++ src/3rdparty/chromium/third_party/blink/renderer/build/scripts/gperf.py @@ -36,10 +36,11 @@ # https://savannah.gnu.org/bugs/index.php?53028 gperf_output = re.sub(r'\bregister ', '', gperf_output) # -Wimplicit-fallthrough needs an explicit fallthrough statement, - # so replace gperf's /*FALLTHROUGH*/ comment with the statement. - # https://savannah.gnu.org/bugs/index.php?53029 - gperf_output = gperf_output.replace('/*FALLTHROUGH*/', - ' FALLTHROUGH;') + # so replace gperf 3.1's /*FALLTHROUGH*/ comment with the statement. + # https://savannah.gnu.org/bugs/index.php?53029 (fixed in 3.2) + if '/* C++ code produced by gperf version 3.1 */' in gperf_output: + gperf_output = gperf_output.replace('/*FALLTHROUGH*/', + ' [[fallthrough]];') # -Wpointer-to-int-cast warns about casting pointers to smaller ints # Replace {(int)(long)&(foo), bar} with # {static_cast(reinterpret_cast(&(foo)), bar}