Patchwork [4,of,7] fuzz: compile xdiff.cc with -std=c++17

login
register
mail settings
Submitter Yuya Nishihara
Date June 3, 2018, 6:43 a.m.
Message ID <c907c0ec7e20a0b0f8c7.1528008222@mimosa>
Download mbox | patch
Permalink /patch/31942/
State Accepted
Headers show

Comments

Yuya Nishihara - June 3, 2018, 6:43 a.m.
# HG changeset patch
# User Yuya Nishihara <yuya@tcha.org>
# Date 1527999493 -32400
#      Sun Jun 03 13:18:13 2018 +0900
# Node ID c907c0ec7e20a0b0f8c7bb818140f4497664c158
# Parent  1b032ef2d1ef65e9a7ea85cd6b21da2f8ffac2c7
fuzz: compile xdiff.cc with -std=c++17

Otherwise the build would fail as follows:

  In file included from xdiff.cc:13:
  ./fuzzutil.h:23:10: fatal error: 'third_party/absl/types/optional.h' file not
  found
  #include "third_party/absl/types/optional.h"

Patch

diff --git a/contrib/fuzz/Makefile b/contrib/fuzz/Makefile
--- a/contrib/fuzz/Makefile
+++ b/contrib/fuzz/Makefile
@@ -34,6 +34,7 @@  x%.o: ../../mercurial/thirdparty/xdiff/x
 	  -o $@ \
 	  $<
 
+xdiff: CXXFLAGS += -std=c++17
 xdiff: xdiff.cc xdiffi.o xprepare.o xutils.o fuzzutil.o
 	$(CXX) $(CXXFLAGS) -DHG_FUZZER_INCLUDE_MAIN=1 -g -O1 -fsanitize=fuzzer-no-link,address \
 	  -I../../mercurial xdiff.cc \