From 14fe8d13cb0b90a62b4458f46fd13a3d096f1902 Mon Sep 17 00:00:00 2001 From: Alexey Gladkov Date: Sat, 16 Feb 2019 20:57:47 +0300 Subject: [PATCH] ALT: Hack to avoid build error with clang7 Signed-off-by: Alexey Gladkov --- third_party/blink/renderer/build/scripts/gperf.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/third_party/blink/renderer/build/scripts/gperf.py b/third_party/blink/renderer/build/scripts/gperf.py index db72660d471..f79f1491e6e 100644 --- a/third_party/blink/renderer/build/scripts/gperf.py +++ b/third_party/blink/renderer/build/scripts/gperf.py @@ -28,20 +28,22 @@ def generate_gperf(gperf_path, gperf_input, gperf_args): stdin=subprocess.PIPE, stdout=subprocess.PIPE, universal_newlines=True) gperf_output = gperf.communicate(gperf_input)[0] # Massage gperf output to be more palatable for modern compilers. # TODO(thakis): Upstream these to gperf so we don't need massaging. # `register` is deprecated in C++11 and removed in C++17, so remove # it from gperf's output. # https://savannah.gnu.org/bugs/index.php?53028 gperf_output = re.sub(r'\bregister ', '', gperf_output) + # Hack to avoid build error with clang7 + gperf_output = re.sub(r'\[\[fallthrough\]\];', '', 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;') # -Wpointer-to-int-cast warns about casting pointers to smaller ints # Replace {(int)(long)&(foo), bar} with # {static_cast(reinterpret_cast(&(foo)), bar} gperf_output = re.sub( r'\(int\)\(long\)(.*?),', -- 2.25.4